[
  {
    "path": ".gitattributes",
    "content": "# Auto detect text files and perform LF normalization\n* text=auto\n\n# Custom for Visual Studio\n*.cs     diff=csharp\n*.sln    merge=union\n*.csproj merge=union\n*.vbproj merge=union\n*.fsproj merge=union\n*.dbproj merge=union\n\n# Standard to msysgit\n*.doc\t diff=astextplain\n*.DOC\t diff=astextplain\n*.docx diff=astextplain\n*.DOCX diff=astextplain\n*.dot  diff=astextplain\n*.DOT  diff=astextplain\n*.pdf  diff=astextplain\n*.PDF\t diff=astextplain\n*.rtf\t diff=astextplain\n*.RTF\t diff=astextplain\n"
  },
  {
    "path": ".gitignore",
    "content": "#################\n## Eclipse\n#################\n\n*.pydevproject\n.project\n.metadata\nbin/\ntmp/\n*.tmp\n*.bak\n*.swp\n*~.nib\nlocal.properties\n.classpath\n.settings/\n.loadpath\n\n# External tool builders\n.externalToolBuilders/\n\n# Locally stored \"Eclipse launch configurations\"\n*.launch\n\n# CDT-specific\n.cproject\n\n# PDT-specific\n.buildpath\n\n\n#################\n## Visual Studio\n#################\n\n## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User-specific files\n*.suo\n*.user\n*.sln.docstates\n\n# Build results\n[Dd]ebug/\n[Rr]elease/\n*_i.c\n*_p.c\n*.ilk\n*.meta\n*.obj\n*.pch\n*.pdb\n*.pgc\n*.pgd\n*.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.vspscc\n.builds\n*.dotCover\n\n## TODO: If you have NuGet Package Restore enabled, uncomment this\n#packages/\n\n# Visual C++ cache files\nipch/\n*.aps\n*.ncb\n*.opensdf\n*.sdf\n\n# Visual Studio profiler\n*.psess\n*.vsp\n\n# ReSharper is a .NET coding add-in\n_ReSharper*\n\n# Installshield output folder\n[Ee]xpress\n\n# DocProject is a documentation generator add-in\nDocProject/buildhelp/\nDocProject/Help/*.HxT\nDocProject/Help/*.HxC\nDocProject/Help/*.hhc\nDocProject/Help/*.hhk\nDocProject/Help/*.hhp\nDocProject/Help/Html2\nDocProject/Help/html\n\n# Click-Once directory\npublish\n\n# Others\n[Bb]in\n[Oo]bj\nsql\nTestResults\n*.Cache\nClientBin\nstylecop.*\n~$*\n*.dbmdl\nGenerated_Code #added for RIA/Silverlight projects\n\n# Backup & report files from converting an old project file to a newer\n# Visual Studio version. Backup files are not needed, because we have git ;-)\n_UpgradeReport_Files/\nBackup*/\nUpgradeLog*.XML\n\n\n\n############\n## Windows\n############\n\n# Windows image file caches\nThumbs.db\n\n# Folder config file\nDesktop.ini\n\n\n#############\n## Python\n#############\n\n*.py[co]\n\n# Packages\n*.egg\n*.egg-info\ndist\nbuild\neggs\nparts\nbin\nvar\nsdist\ndevelop-eggs\n.installed.cfg\n\n# Installer logs\npip-log.txt\n\n# Unit test / coverage reports\n.coverage\n.tox\n\n#Translations\n*.mo\n\n#Mr Developer\n.mr.developer.cfg\n\n# Mac crap\n.DS_Store\nsftp-config.json\nsftp-config-alt.json\nlogs\nsessions\n"
  },
  {
    "path": "Context.sublime-menu",
    "content": "[\n    { \"caption\": \"-\" },\n    {\n        \"command\":\"send_to_evernote\",\n        \"caption\":\"Send to Evernote\"\n    },       \n    {\n        \"caption\": \"Evernote Settings\",\n        \"command\": \"open_file\", \"args\":\n        {\n            \"file\": \"${packages}/User/SublimeEvernote.sublime-settings\"\n        }\n    },      \n    { \"caption\": \"-\" }\n]"
  },
  {
    "path": "Default (Linux).sublime-keymap",
    "content": "[\n  { \"keys\": [\"ctrl+alt+e\"], \"command\": \"send_to_evernote\" }\n]"
  },
  {
    "path": "Default (OSX).sublime-keymap",
    "content": "[\n  { \"keys\": [\"super+alt+e\"], \"command\": \"send_to_evernote\" }\n]"
  },
  {
    "path": "Default (Windows).sublime-keymap",
    "content": "[\n  { \"keys\": [\"ctrl+alt+e\"], \"command\": \"send_to_evernote\" }\n]\n"
  },
  {
    "path": "Default.sublime-commands",
    "content": "[\n    { \"command\": \"send_to_evernote\", \"caption\": \"Send to evernote\" },    \n    {\n        \"caption\": \"Evernote Settings\",\n        \"command\": \"open_file\", \"args\":\n        {\n            \"file\": \"${packages}/User/SublimeEvernote.sublime-settings\"\n        }\n    }        \n]\n"
  },
  {
    "path": "Readme.md",
    "content": "SublimeEvernote\n===============\n\n[Sublime Text 2](http://www.sublimetext.com/2) plugin for [Evernote](http://www.evernote.com) \n\n\n### Install\n\nThrough [Package Control](http://wbond.net/sublime_packages/package_control)\n\n`Command Palette` > `Package Control: Install Package` > `SublimeEvernote`\n\nor\n\n`Command Palette` > `Package Control: add Repository` && `input 'http://github.com/jamiesun/SublimeEvernote`\n\n`Command Palette` > `Package Control: Install Package` > `SublimeEvernote`\n\nor clone this repository in\n\n* Windows: `%APPDATA%/Roaming/Sublime Text 2/Packages/`\n* OSX: `~/Library/Application Support/Sublime Text 2/Packages/`\n* Linux: `~/.Sublime Text 2/Packages/`\n* Portable Installation: `Sublime Text 2/Data/`\n\n### Usage\n\n`Command Palette` > `Send to evernote`\n\n`Context menu` > `Send to Evernote`\n\n`Context menu` > `Evernote settings`\n\n#### Markdown Support ####\n\nWrite notes in Markdown and they will be processed when they are sent to Evernote.\n\nThis:\n![this](https://dl.dropbox.com/u/643062/SublimeEvernoteScreenshots/Markdown.png)\n\nTurns into this:\n![this](https://dl.dropbox.com/u/643062/SublimeEvernoteScreenshots/Evernote.png)\n\n#### Authenticating with Evernote ####\n\nIn order to send notes you need to authenticate and allow the plugin permissions via Evernote's oauth. \nThis is a bit of a manual process now as there are no callbacks to Sublime to handle this process automatically.\nHere are a collection of screenshots to step you through the process.\n\n##### Step 1 - Sublime text2 open your browser,you need login:\n![login](https://raw.githubusercontent.com/jamiesun/SublimeEvernote/master/snapshot/login.png)\n\n##### Step 2 - Authorize plugin with Evernote:\n![authorize](https://raw.github.com/dencold/static/master/images/sublimeevernote/2_authorize.png)\n\n##### Step 3 - Copy oauth verifier\n![redirect](https://raw.github.com/dencold/static/master/images/sublimeevernote/3_redirect.png)\n![verifier](https://raw.github.com/dencold/static/master/images/sublimeevernote/4_oauth_verifier.png)\n\n##### Step 4 - Verify token on Sublime\n![redirect](https://raw.github.com/dencold/static/master/images/sublimeevernote/5_verify_sublime.png)\n\n##### Step 5 - Rejoice!\n![redirect](https://raw.github.com/dencold/static/master/images/sublimeevernote/6_rejoice.png)\n\n#### Metadata ####\n\nUse metadata block to specify title and tags.\n\n    ---\n    title: My Note\n    tags: tag1,tag2\n    ---\n"
  },
  {
    "path": "SublimeEvernoteMetadata.sublime-snippet",
    "content": "<snippet>\n\t<content><![CDATA[\n---\ntitle: $1\ntags: $2\n---\n]]></content>\n\t<description>Evernote Metadata</description>\n\t<scope>text.plain,text.html,text.html.markdown,text.html.markdown.multimarkdown</scope>\n</snippet>\n"
  },
  {
    "path": "lib/__init__.py",
    "content": ""
  },
  {
    "path": "lib/evernote/__init__.py",
    "content": ""
  },
  {
    "path": "lib/evernote/api/__init__.py",
    "content": ""
  },
  {
    "path": "lib/evernote/api/client.py",
    "content": "import sys\nimport functools\nimport inspect\nimport re\nimport oauth2 as oauth\nimport urllib\nimport urlparse\n\nimport evernote.edam.userstore.UserStore as UserStore\nimport evernote.edam.notestore.NoteStore as NoteStore\nimport evernote.edam.userstore.constants as UserStoreConstants\n\nimport thrift.protocol.TBinaryProtocol as TBinaryProtocol\nimport thrift.transport.THttpClient as THttpClient\n\n\nclass EvernoteClient(object):\n\n    def __init__(self, **options):\n        self.consumer_key = options.get('consumer_key')\n        self.consumer_secret = options.get('consumer_secret')\n        self.sandbox = options.get('sandbox', True)\n        if self.sandbox:\n            default_service_host = 'sandbox.evernote.com'\n        else:\n            default_service_host = 'www.evernote.com'\n        self.service_host = options.get('service_host', default_service_host)\n        self.additional_headers = options.get('additional_headers', {})\n        self.token = options.get('token')\n        self.secret = options.get('secret')\n\n    def get_request_token(self, callback_url):\n        client = self._get_oauth_client()\n        request_url = '%s?oauth_callback=%s' % (\n            self._get_endpoint('oauth'), urllib.quote(callback_url))\n\n        resp, content = client.request(request_url, 'GET')\n        request_token = dict(urlparse.parse_qsl(content))\n        return request_token\n\n    def get_authorize_url(self, request_token):\n        return '%s?oauth_token=%s' % (\n            self._get_endpoint('OAuth.action'),\n            urllib.quote(request_token['oauth_token']))\n\n    def get_access_token(\n        self, oauth_token, oauth_token_secret, oauth_verifier\n    ):\n        token = oauth.Token(oauth_token, oauth_token_secret)\n        token.set_verifier(oauth_verifier)\n        client = self._get_oauth_client(token)\n\n        resp, content = client.request(self._get_endpoint('oauth'), 'POST')\n        access_token = dict(urlparse.parse_qsl(content))\n        self.token = access_token['oauth_token']\n        return self.token\n\n    def get_user_store(self):\n        user_store_uri = self._get_endpoint(\"/edam/user\")\n        store = Store(self.token, UserStore.Client, user_store_uri)\n        if not store:  # Trick for PyDev code completion\n            store = UserStore.Client()\n            raise Exception('Should never reach here')\n        return store\n\n    def get_note_store(self):\n        user_store = self.get_user_store()\n        note_store_uri = user_store.getNoteStoreUrl()\n        store = Store(self.token, NoteStore.Client, note_store_uri)\n        if not store:  # Trick for PyDev code completion\n            store = NoteStore.Client()\n            raise Exception('Should never reach here')\n        return store\n\n    def get_shared_note_store(self, linkedNotebook):\n        note_store_uri = linkedNotebook.noteStoreUrl\n        note_store = Store(self.token, NoteStore.Client, note_store_uri)\n        shared_auth = note_store.authenticateToSharedNotebook(\n            linkedNotebook.shareKey)\n        shared_token = shared_auth.authenticationToken\n        store = Store(shared_token, NoteStore.Client, note_store_uri)\n        if not store:  # Trick for PyDev code completion\n            store = NoteStore.Client()\n            raise Exception('Should never reach here')\n        return store\n\n    def get_business_note_store(self):\n        user_store = self.get_user_store()\n        biz_auth = user_store.authenticateToBusiness()\n        biz_token = biz_auth.authenticationToken\n        note_store_uri = biz_auth.noteStoreUrl\n        store = Store(biz_token, NoteStore.Client, note_store_uri)\n        if not store:  # Trick for PyDev code completion\n            store = NoteStore.Client()\n            raise Exception('Should never reach here')\n        return store\n\n    def _get_oauth_client(self, token=None):\n        consumer = oauth.Consumer(self.consumer_key, self.consumer_secret)\n        if token:\n            client = oauth.Client(consumer, token)\n        else:\n            client = oauth.Client(consumer)\n        return client\n\n    def _get_endpoint(self, path=None):\n        url = \"https://%s\" % (self.service_host)\n        if path is not None:\n            url += \"/%s\" % path\n        return url\n\n\nclass Store(object):\n\n    def __init__(self, token, client_class, store_url):\n        self.token = token\n        m = re.search(':A=(.+):', token)\n        if m:\n            self._user_agent_id = m.groups()[0]\n        else:\n            self._user_agent_id = ''\n        self._client = self._get_thrift_client(client_class, store_url)\n\n    def __getattr__(self, name):\n        def delegate_method(*args, **kwargs):\n            targetMethod = getattr(self._client, name, None)\n            if targetMethod is None:\n                return object.__getattribute__(self, name)(*args, **kwargs)\n\n            org_args = inspect.getargspec(targetMethod).args\n            if len(org_args) == len(args) + 1:\n                return targetMethod(*args, **kwargs)\n            elif 'authenticationToken' in org_args:\n                skip_args = ['self', 'authenticationToken']\n                arg_names = [i for i in org_args if i not in skip_args]\n                return functools.partial(\n                    targetMethod, authenticationToken=self.token\n                )(**dict(zip(arg_names, args)))\n            else:\n                return targetMethod(*args, **kwargs)\n\n        return delegate_method\n\n    def _get_thrift_client(self, client_class, url):\n        http_client = THttpClient.THttpClient(url)\n        http_client.addHeaders(**{\n            'User-Agent': \"%s / %s; Python / %s;\"\n            % (self._user_agent_id, self._get_sdk_version(), sys.version)\n        })\n\n        thrift_protocol = TBinaryProtocol.TBinaryProtocol(http_client)\n        return client_class(thrift_protocol)\n\n    def _get_sdk_version(self):\n        return '%s.%s' % (\n            UserStoreConstants.EDAM_VERSION_MAJOR,\n            UserStoreConstants.EDAM_VERSION_MINOR\n        )\n"
  },
  {
    "path": "lib/evernote/edam/__init__.py",
    "content": ""
  },
  {
    "path": "lib/evernote/edam/error/__init__.py",
    "content": "__all__ = ['ttypes', 'constants']\n"
  },
  {
    "path": "lib/evernote/edam/error/constants.py",
    "content": "#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nfrom ttypes import *\n\n"
  },
  {
    "path": "lib/evernote/edam/error/ttypes.py",
    "content": "#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\n\nfrom thrift.transport import TTransport\nfrom thrift.protocol import TBinaryProtocol, TProtocol\ntry:\n  from thrift.protocol import fastbinary\nexcept:\n  fastbinary = None\n\n\nclass EDAMErrorCode(object):\n  \"\"\"\n  Numeric codes indicating the type of error that occurred on the\n  service.\n  <dl>\n    <dt>UNKNOWN</dt>\n      <dd>No information available about the error</dd>\n    <dt>BAD_DATA_FORMAT</dt>\n      <dd>The format of the request data was incorrect</dd>\n    <dt>PERMISSION_DENIED</dt>\n      <dd>Not permitted to perform action</dd>\n    <dt>INTERNAL_ERROR</dt>\n      <dd>Unexpected problem with the service</dd>\n    <dt>DATA_REQUIRED</dt>\n      <dd>A required parameter/field was absent</dd>\n    <dt>LIMIT_REACHED</dt>\n      <dd>Operation denied due to data model limit</dd>\n    <dt>QUOTA_REACHED</dt>\n      <dd>Operation denied due to user storage limit</dd>\n    <dt>INVALID_AUTH</dt>\n      <dd>Username and/or password incorrect</dd>\n    <dt>AUTH_EXPIRED</dt>\n      <dd>Authentication token expired</dd>\n    <dt>DATA_CONFLICT</dt>\n      <dd>Change denied due to data model conflict</dd>\n    <dt>ENML_VALIDATION</dt>\n      <dd>Content of submitted note was malformed</dd>\n    <dt>SHARD_UNAVAILABLE</dt>\n      <dd>Service shard with account data is temporarily down</dd>\n    <dt>LEN_TOO_SHORT</dt>\n      <dd>Operation denied due to data model limit, where something such\n          as a string length was too short</dd>\n    <dt>LEN_TOO_LONG</dt>\n      <dd>Operation denied due to data model limit, where something such\n          as a string length was too long</dd>\n    <dt>TOO_FEW</dt>\n      <dd>Operation denied due to data model limit, where there were\n          too few of something.</dd>\n    <dt>TOO_MANY</dt>\n      <dd>Operation denied due to data model limit, where there were\n          too many of something.</dd>\n    <dt>UNSUPPORTED_OPERATION</dt>\n      <dd>Operation denied because it is currently unsupported.</dd>\n    <dt>TAKEN_DOWN</dt>\n      <dd>Operation denied because access to the corresponding object is\n          prohibited in response to a take-down notice.</dd>\n    <dt>RATE_LIMIT_REACHED</dt>\n      <dd>Operation denied because the calling application has reached\n          its hourly API call limit for this user.</dd>\n  </dl>\n  \"\"\"\n  UNKNOWN = 1\n  BAD_DATA_FORMAT = 2\n  PERMISSION_DENIED = 3\n  INTERNAL_ERROR = 4\n  DATA_REQUIRED = 5\n  LIMIT_REACHED = 6\n  QUOTA_REACHED = 7\n  INVALID_AUTH = 8\n  AUTH_EXPIRED = 9\n  DATA_CONFLICT = 10\n  ENML_VALIDATION = 11\n  SHARD_UNAVAILABLE = 12\n  LEN_TOO_SHORT = 13\n  LEN_TOO_LONG = 14\n  TOO_FEW = 15\n  TOO_MANY = 16\n  UNSUPPORTED_OPERATION = 17\n  TAKEN_DOWN = 18\n  RATE_LIMIT_REACHED = 19\n\n  _VALUES_TO_NAMES = {\n    1: \"UNKNOWN\",\n    2: \"BAD_DATA_FORMAT\",\n    3: \"PERMISSION_DENIED\",\n    4: \"INTERNAL_ERROR\",\n    5: \"DATA_REQUIRED\",\n    6: \"LIMIT_REACHED\",\n    7: \"QUOTA_REACHED\",\n    8: \"INVALID_AUTH\",\n    9: \"AUTH_EXPIRED\",\n    10: \"DATA_CONFLICT\",\n    11: \"ENML_VALIDATION\",\n    12: \"SHARD_UNAVAILABLE\",\n    13: \"LEN_TOO_SHORT\",\n    14: \"LEN_TOO_LONG\",\n    15: \"TOO_FEW\",\n    16: \"TOO_MANY\",\n    17: \"UNSUPPORTED_OPERATION\",\n    18: \"TAKEN_DOWN\",\n    19: \"RATE_LIMIT_REACHED\",\n  }\n\n  _NAMES_TO_VALUES = {\n    \"UNKNOWN\": 1,\n    \"BAD_DATA_FORMAT\": 2,\n    \"PERMISSION_DENIED\": 3,\n    \"INTERNAL_ERROR\": 4,\n    \"DATA_REQUIRED\": 5,\n    \"LIMIT_REACHED\": 6,\n    \"QUOTA_REACHED\": 7,\n    \"INVALID_AUTH\": 8,\n    \"AUTH_EXPIRED\": 9,\n    \"DATA_CONFLICT\": 10,\n    \"ENML_VALIDATION\": 11,\n    \"SHARD_UNAVAILABLE\": 12,\n    \"LEN_TOO_SHORT\": 13,\n    \"LEN_TOO_LONG\": 14,\n    \"TOO_FEW\": 15,\n    \"TOO_MANY\": 16,\n    \"UNSUPPORTED_OPERATION\": 17,\n    \"TAKEN_DOWN\": 18,\n    \"RATE_LIMIT_REACHED\": 19,\n  }\n\n\nclass EDAMUserException(TException):\n  \"\"\"\n  This exception is thrown by EDAM procedures when a call fails as a result of\n  a problem that a caller may be able to resolve.  For example, if the user\n  attempts to add a note to their account which would exceed their storage\n  quota, this type of exception may be thrown to indicate the source of the\n  error so that they can choose an alternate action.\n  \n  This exception would not be used for internal system errors that do not\n  reflect user actions, but rather reflect a problem within the service that\n  the user cannot resolve.\n  \n  errorCode:  The numeric code indicating the type of error that occurred.\n    must be one of the values of EDAMErrorCode.\n  \n  parameter:  If the error applied to a particular input parameter, this will\n    indicate which parameter.\n  \n  Attributes:\n   - errorCode\n   - parameter\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I32, 'errorCode', None, None, ), # 1\n    (2, TType.STRING, 'parameter', None, None, ), # 2\n  )\n\n  def __init__(self, errorCode=None, parameter=None,):\n    self.errorCode = errorCode\n    self.parameter = parameter\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I32:\n          self.errorCode = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.parameter = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('EDAMUserException')\n    if self.errorCode is not None:\n      oprot.writeFieldBegin('errorCode', TType.I32, 1)\n      oprot.writeI32(self.errorCode)\n      oprot.writeFieldEnd()\n    if self.parameter is not None:\n      oprot.writeFieldBegin('parameter', TType.STRING, 2)\n      oprot.writeString(self.parameter)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.errorCode is None:\n      raise TProtocol.TProtocolException(message='Required field errorCode is unset!')\n    return\n\n\n  def __str__(self):\n    return repr(self)\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass EDAMSystemException(TException):\n  \"\"\"\n  This exception is thrown by EDAM procedures when a call fails as a result of\n  a problem in the service that could not be changed through caller action.\n  \n  errorCode:  The numeric code indicating the type of error that occurred.\n    must be one of the values of EDAMErrorCode.\n  \n  message:  This may contain additional information about the error\n  \n  rateLimitDuration:  Indicates the minimum number of seconds that an application should\n    expect subsequent API calls for this user to fail. The application should not retry\n    API requests for the user until at least this many seconds have passed. Present only\n    when errorCode is RATE_LIMIT_REACHED,\n  \n  Attributes:\n   - errorCode\n   - message\n   - rateLimitDuration\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I32, 'errorCode', None, None, ), # 1\n    (2, TType.STRING, 'message', None, None, ), # 2\n    (3, TType.I32, 'rateLimitDuration', None, None, ), # 3\n  )\n\n  def __init__(self, errorCode=None, message=None, rateLimitDuration=None,):\n    self.errorCode = errorCode\n    self.message = message\n    self.rateLimitDuration = rateLimitDuration\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I32:\n          self.errorCode = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.message = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.rateLimitDuration = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('EDAMSystemException')\n    if self.errorCode is not None:\n      oprot.writeFieldBegin('errorCode', TType.I32, 1)\n      oprot.writeI32(self.errorCode)\n      oprot.writeFieldEnd()\n    if self.message is not None:\n      oprot.writeFieldBegin('message', TType.STRING, 2)\n      oprot.writeString(self.message)\n      oprot.writeFieldEnd()\n    if self.rateLimitDuration is not None:\n      oprot.writeFieldBegin('rateLimitDuration', TType.I32, 3)\n      oprot.writeI32(self.rateLimitDuration)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.errorCode is None:\n      raise TProtocol.TProtocolException(message='Required field errorCode is unset!')\n    return\n\n\n  def __str__(self):\n    return repr(self)\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass EDAMNotFoundException(TException):\n  \"\"\"\n  This exception is thrown by EDAM procedures when a caller asks to perform\n  an operation on an object that does not exist.  This may be thrown based on an invalid\n  primary identifier (e.g. a bad GUID), or when the caller refers to an object\n  by another unique identifier (e.g. a User's email address).\n  \n  identifier:  A description of the object that was not found on the server.\n    For example, \"Note.notebookGuid\" when a caller attempts to create a note in a\n    notebook that does not exist in the user's account.\n  \n  key:  The value passed from the client in the identifier, which was not\n    found. For example, the GUID that was not found.\n  \n  Attributes:\n   - identifier\n   - key\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'identifier', None, None, ), # 1\n    (2, TType.STRING, 'key', None, None, ), # 2\n  )\n\n  def __init__(self, identifier=None, key=None,):\n    self.identifier = identifier\n    self.key = key\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.identifier = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.key = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('EDAMNotFoundException')\n    if self.identifier is not None:\n      oprot.writeFieldBegin('identifier', TType.STRING, 1)\n      oprot.writeString(self.identifier)\n      oprot.writeFieldEnd()\n    if self.key is not None:\n      oprot.writeFieldBegin('key', TType.STRING, 2)\n      oprot.writeString(self.key)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __str__(self):\n    return repr(self)\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n"
  },
  {
    "path": "lib/evernote/edam/limits/__init__.py",
    "content": "__all__ = ['ttypes', 'constants']\n"
  },
  {
    "path": "lib/evernote/edam/limits/constants.py",
    "content": "#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nfrom ttypes import *\n\nEDAM_ATTRIBUTE_LEN_MIN = 1\nEDAM_ATTRIBUTE_LEN_MAX = 4096\nEDAM_ATTRIBUTE_REGEX = \"^[^\\\\p{Cc}\\\\p{Zl}\\\\p{Zp}]{1,4096}$\"\nEDAM_ATTRIBUTE_LIST_MAX = 100\nEDAM_ATTRIBUTE_MAP_MAX = 100\nEDAM_GUID_LEN_MIN = 36\nEDAM_GUID_LEN_MAX = 36\nEDAM_GUID_REGEX = \"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$\"\nEDAM_EMAIL_LEN_MIN = 6\nEDAM_EMAIL_LEN_MAX = 255\nEDAM_EMAIL_LOCAL_REGEX = \"^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(\\\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*$\"\nEDAM_EMAIL_DOMAIN_REGEX = \"^[A-Za-z0-9-]+(\\\\.[A-Za-z0-9-]+)*\\\\.([A-Za-z]{2,})$\"\nEDAM_EMAIL_REGEX = \"^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(\\\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[A-Za-z0-9-]+(\\\\.[A-Za-z0-9-]+)*\\\\.([A-Za-z]{2,})$\"\nEDAM_VAT_REGEX = \"^((AT)?U[0-9]{8}|(BE)?0?[0-9]{9}|(BG)?[0-9]{9,10}|(CY)?[0-9]{8}L|(CZ)?[0-9]{8,10}|(DE)?[0-9]{9}|(DK)?[0-9]{8}|(EE)?[0-9]{9}|(EL|GR)?[0-9]{9}|(ES)?[0-9A-Z][0-9]{7}[0-9A-Z]|(FI)?[0-9]{8}|(FR)?[0-9A-Z]{2}[0-9]{9}|(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})|(HU)?[0-9]{8}|(IE)?[0-9]S[0-9]{5}L|(IT)?[0-9]{11}|(LT)?([0-9]{9}|[0-9]{12})|(LU)?[0-9]{8}|(LV)?[0-9]{11}|(MT)?[0-9]{8}|(NL)?[0-9]{9}B[0-9]{2}|(PL)?[0-9]{10}|(PT)?[0-9]{9}|(RO)?[0-9]{2,10}|(SE)?[0-9]{12}|(SI)?[0-9]{8}|(SK)?[0-9]{10})|[0-9]{9}MVA|[0-9]{6}|CHE[0-9]{9}(TVA|MWST|IVA)$\"\nEDAM_TIMEZONE_LEN_MIN = 1\nEDAM_TIMEZONE_LEN_MAX = 32\nEDAM_TIMEZONE_REGEX = \"^([A-Za-z_-]+(/[A-Za-z_-]+)*)|(GMT(-|\\\\+)[0-9]{1,2}(:[0-9]{2})?)$\"\nEDAM_MIME_LEN_MIN = 3\nEDAM_MIME_LEN_MAX = 255\nEDAM_MIME_REGEX = \"^[A-Za-z]+/[A-Za-z0-9._+-]+$\"\nEDAM_MIME_TYPE_GIF = \"image/gif\"\nEDAM_MIME_TYPE_JPEG = \"image/jpeg\"\nEDAM_MIME_TYPE_PNG = \"image/png\"\nEDAM_MIME_TYPE_WAV = \"audio/wav\"\nEDAM_MIME_TYPE_MP3 = \"audio/mpeg\"\nEDAM_MIME_TYPE_AMR = \"audio/amr\"\nEDAM_MIME_TYPE_AAC = \"audio/aac\"\nEDAM_MIME_TYPE_M4A = \"audio/mp4\"\nEDAM_MIME_TYPE_MP4_VIDEO = \"video/mp4\"\nEDAM_MIME_TYPE_INK = \"application/vnd.evernote.ink\"\nEDAM_MIME_TYPE_PDF = \"application/pdf\"\nEDAM_MIME_TYPE_DEFAULT = \"application/octet-stream\"\nEDAM_MIME_TYPES = set([\n  \"image/gif\",\n  \"image/jpeg\",\n  \"image/png\",\n  \"audio/wav\",\n  \"audio/mpeg\",\n  \"audio/amr\",\n  \"application/vnd.evernote.ink\",\n  \"application/pdf\",\n  \"video/mp4\",\n  \"audio/aac\",\n  \"audio/mp4\",\n])\nEDAM_INDEXABLE_RESOURCE_MIME_TYPES = set([\n  \"application/msword\",\n  \"application/mspowerpoint\",\n  \"application/excel\",\n  \"application/vnd.ms-word\",\n  \"application/vnd.ms-powerpoint\",\n  \"application/vnd.ms-excel\",\n  \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n  \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n  \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n  \"application/vnd.apple.pages\",\n  \"application/vnd.apple.numbers\",\n  \"application/vnd.apple.keynote\",\n  \"application/x-iwork-pages-sffpages\",\n  \"application/x-iwork-numbers-sffnumbers\",\n  \"application/x-iwork-keynote-sffkey\",\n])\nEDAM_SEARCH_QUERY_LEN_MIN = 0\nEDAM_SEARCH_QUERY_LEN_MAX = 1024\nEDAM_SEARCH_QUERY_REGEX = \"^[^\\\\p{Cc}\\\\p{Zl}\\\\p{Zp}]{0,1024}$\"\nEDAM_HASH_LEN = 16\nEDAM_USER_USERNAME_LEN_MIN = 1\nEDAM_USER_USERNAME_LEN_MAX = 64\nEDAM_USER_USERNAME_REGEX = \"^[a-z0-9]([a-z0-9_-]{0,62}[a-z0-9])?$\"\nEDAM_USER_NAME_LEN_MIN = 1\nEDAM_USER_NAME_LEN_MAX = 255\nEDAM_USER_NAME_REGEX = \"^[^\\\\p{Cc}\\\\p{Zl}\\\\p{Zp}]{1,255}$\"\nEDAM_TAG_NAME_LEN_MIN = 1\nEDAM_TAG_NAME_LEN_MAX = 100\nEDAM_TAG_NAME_REGEX = \"^[^,\\\\p{Cc}\\\\p{Z}]([^,\\\\p{Cc}\\\\p{Zl}\\\\p{Zp}]{0,98}[^,\\\\p{Cc}\\\\p{Z}])?$\"\nEDAM_NOTE_TITLE_LEN_MIN = 1\nEDAM_NOTE_TITLE_LEN_MAX = 255\nEDAM_NOTE_TITLE_REGEX = \"^[^\\\\p{Cc}\\\\p{Z}]([^\\\\p{Cc}\\\\p{Zl}\\\\p{Zp}]{0,253}[^\\\\p{Cc}\\\\p{Z}])?$\"\nEDAM_NOTE_CONTENT_LEN_MIN = 0\nEDAM_NOTE_CONTENT_LEN_MAX = 5242880\nEDAM_APPLICATIONDATA_NAME_LEN_MIN = 3\nEDAM_APPLICATIONDATA_NAME_LEN_MAX = 32\nEDAM_APPLICATIONDATA_VALUE_LEN_MIN = 0\nEDAM_APPLICATIONDATA_VALUE_LEN_MAX = 4092\nEDAM_APPLICATIONDATA_ENTRY_LEN_MAX = 4095\nEDAM_APPLICATIONDATA_NAME_REGEX = \"^[A-Za-z0-9_.-]{3,32}$\"\nEDAM_APPLICATIONDATA_VALUE_REGEX = \"^[^\\\\p{Cc}]{0,4092}$\"\nEDAM_NOTEBOOK_NAME_LEN_MIN = 1\nEDAM_NOTEBOOK_NAME_LEN_MAX = 100\nEDAM_NOTEBOOK_NAME_REGEX = \"^[^\\\\p{Cc}\\\\p{Z}]([^\\\\p{Cc}\\\\p{Zl}\\\\p{Zp}]{0,98}[^\\\\p{Cc}\\\\p{Z}])?$\"\nEDAM_NOTEBOOK_STACK_LEN_MIN = 1\nEDAM_NOTEBOOK_STACK_LEN_MAX = 100\nEDAM_NOTEBOOK_STACK_REGEX = \"^[^\\\\p{Cc}\\\\p{Z}]([^\\\\p{Cc}\\\\p{Zl}\\\\p{Zp}]{0,98}[^\\\\p{Cc}\\\\p{Z}])?$\"\nEDAM_PUBLISHING_URI_LEN_MIN = 1\nEDAM_PUBLISHING_URI_LEN_MAX = 255\nEDAM_PUBLISHING_URI_REGEX = \"^[a-zA-Z0-9.~_+-]{1,255}$\"\nEDAM_PUBLISHING_URI_PROHIBITED = set([\n  \"..\",\n])\nEDAM_PUBLISHING_DESCRIPTION_LEN_MIN = 1\nEDAM_PUBLISHING_DESCRIPTION_LEN_MAX = 200\nEDAM_PUBLISHING_DESCRIPTION_REGEX = \"^[^\\\\p{Cc}\\\\p{Z}]([^\\\\p{Cc}\\\\p{Zl}\\\\p{Zp}]{0,198}[^\\\\p{Cc}\\\\p{Z}])?$\"\nEDAM_SAVED_SEARCH_NAME_LEN_MIN = 1\nEDAM_SAVED_SEARCH_NAME_LEN_MAX = 100\nEDAM_SAVED_SEARCH_NAME_REGEX = \"^[^\\\\p{Cc}\\\\p{Z}]([^\\\\p{Cc}\\\\p{Zl}\\\\p{Zp}]{0,98}[^\\\\p{Cc}\\\\p{Z}])?$\"\nEDAM_USER_PASSWORD_LEN_MIN = 6\nEDAM_USER_PASSWORD_LEN_MAX = 64\nEDAM_USER_PASSWORD_REGEX = \"^[A-Za-z0-9!#$%&'()*+,./:;<=>?@^_`{|}~\\\\[\\\\]\\\\\\\\-]{6,64}$\"\nEDAM_BUSINESS_URI_LEN_MAX = 32\nEDAM_NOTE_TAGS_MAX = 100\nEDAM_NOTE_RESOURCES_MAX = 1000\nEDAM_USER_TAGS_MAX = 100000\nEDAM_BUSINESS_TAGS_MAX = 100000\nEDAM_USER_SAVED_SEARCHES_MAX = 100\nEDAM_USER_NOTES_MAX = 100000\nEDAM_BUSINESS_NOTES_MAX = 500000\nEDAM_USER_NOTEBOOKS_MAX = 250\nEDAM_BUSINESS_NOTEBOOKS_MAX = 5000\nEDAM_USER_RECENT_MAILED_ADDRESSES_MAX = 10\nEDAM_USER_MAIL_LIMIT_DAILY_FREE = 50\nEDAM_USER_MAIL_LIMIT_DAILY_PREMIUM = 200\nEDAM_USER_UPLOAD_LIMIT_FREE = 62914560\nEDAM_USER_UPLOAD_LIMIT_PREMIUM = 1073741824\nEDAM_USER_UPLOAD_LIMIT_BUSINESS = 2147483647\nEDAM_NOTE_SIZE_MAX_FREE = 26214400\nEDAM_NOTE_SIZE_MAX_PREMIUM = 104857600\nEDAM_RESOURCE_SIZE_MAX_FREE = 26214400\nEDAM_RESOURCE_SIZE_MAX_PREMIUM = 104857600\nEDAM_USER_LINKED_NOTEBOOK_MAX = 100\nEDAM_USER_LINKED_NOTEBOOK_MAX_PREMIUM = 250\nEDAM_NOTEBOOK_SHARED_NOTEBOOK_MAX = 250\nEDAM_NOTE_CONTENT_CLASS_LEN_MIN = 3\nEDAM_NOTE_CONTENT_CLASS_LEN_MAX = 32\nEDAM_NOTE_CONTENT_CLASS_REGEX = \"^[A-Za-z0-9_.-]{3,32}$\"\nEDAM_HELLO_APP_CONTENT_CLASS_PREFIX = \"evernote.hello.\"\nEDAM_FOOD_APP_CONTENT_CLASS_PREFIX = \"evernote.food.\"\nEDAM_CONTENT_CLASS_HELLO_ENCOUNTER = \"evernote.hello.encounter\"\nEDAM_CONTENT_CLASS_HELLO_PROFILE = \"evernote.hello.profile\"\nEDAM_CONTENT_CLASS_FOOD_MEAL = \"evernote.food.meal\"\nEDAM_CONTENT_CLASS_SKITCH_PREFIX = \"evernote.skitch\"\nEDAM_CONTENT_CLASS_SKITCH = \"evernote.skitch\"\nEDAM_CONTENT_CLASS_SKITCH_PDF = \"evernote.skitch.pdf\"\nEDAM_CONTENT_CLASS_PENULTIMATE_PREFIX = \"evernote.penultimate.\"\nEDAM_CONTENT_CLASS_PENULTIMATE_NOTEBOOK = \"evernote.penultimate.notebook\"\nEDAM_RELATED_PLAINTEXT_LEN_MIN = 1\nEDAM_RELATED_PLAINTEXT_LEN_MAX = 131072\nEDAM_RELATED_MAX_NOTES = 25\nEDAM_RELATED_MAX_NOTEBOOKS = 1\nEDAM_RELATED_MAX_TAGS = 25\nEDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MIN = 1\nEDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MAX = 200\nEDAM_BUSINESS_NOTEBOOK_DESCRIPTION_REGEX = \"^[^\\\\p{Cc}\\\\p{Z}]([^\\\\p{Cc}\\\\p{Zl}\\\\p{Zp}]{0,198}[^\\\\p{Cc}\\\\p{Z}])?$\"\nEDAM_BUSINESS_PHONE_NUMBER_LEN_MAX = 20\nEDAM_PREFERENCE_NAME_LEN_MIN = 3\nEDAM_PREFERENCE_NAME_LEN_MAX = 32\nEDAM_PREFERENCE_VALUE_LEN_MIN = 1\nEDAM_PREFERENCE_VALUE_LEN_MAX = 1024\nEDAM_MAX_PREFERENCES = 100\nEDAM_MAX_VALUES_PER_PREFERENCE = 256\nEDAM_PREFERENCE_NAME_REGEX = \"^[A-Za-z0-9_.-]{3,32}$\"\nEDAM_PREFERENCE_VALUE_REGEX = \"^[^\\\\p{Cc}]{1,1024}$\"\nEDAM_PREFERENCE_SHORTCUTS = \"evernote.shortcuts\"\nEDAM_PREFERENCE_SHORTCUTS_MAX_VALUES = 250\nEDAM_DEVICE_ID_LEN_MAX = 32\nEDAM_DEVICE_ID_REGEX = \"^[^\\\\p{Cc}]{1,32}$\"\nEDAM_DEVICE_DESCRIPTION_LEN_MAX = 64\nEDAM_DEVICE_DESCRIPTION_REGEX = \"^[^\\\\p{Cc}]{1,64}$\"\nEDAM_SEARCH_SUGGESTIONS_MAX = 10\nEDAM_SEARCH_SUGGESTIONS_PREFIX_LEN_MAX = 1024\nEDAM_SEARCH_SUGGESTIONS_PREFIX_LEN_MIN = 2\n"
  },
  {
    "path": "lib/evernote/edam/limits/ttypes.py",
    "content": "#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\n\nfrom thrift.transport import TTransport\nfrom thrift.protocol import TBinaryProtocol, TProtocol\ntry:\n  from thrift.protocol import fastbinary\nexcept:\n  fastbinary = None\n\n\n"
  },
  {
    "path": "lib/evernote/edam/notestore/NoteStore-remote",
    "content": "#!/usr/bin/env python\n#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nimport sys\nimport pprint\nfrom urlparse import urlparse\nfrom thrift.transport import TTransport\nfrom thrift.transport import TSocket\nfrom thrift.transport import THttpClient\nfrom thrift.protocol import TBinaryProtocol\n\nimport NoteStore\nfrom ttypes import *\n\nif len(sys.argv) <= 1 or sys.argv[1] == '--help':\n  print ''\n  print 'Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] function [arg1 [arg2...]]'\n  print ''\n  print 'Functions:'\n  print '  SyncState getSyncState(string authenticationToken)'\n  print '  SyncState getSyncStateWithMetrics(string authenticationToken, ClientUsageMetrics clientMetrics)'\n  print '  SyncChunk getSyncChunk(string authenticationToken, i32 afterUSN, i32 maxEntries, bool fullSyncOnly)'\n  print '  SyncChunk getFilteredSyncChunk(string authenticationToken, i32 afterUSN, i32 maxEntries, SyncChunkFilter filter)'\n  print '  SyncState getLinkedNotebookSyncState(string authenticationToken, LinkedNotebook linkedNotebook)'\n  print '  SyncChunk getLinkedNotebookSyncChunk(string authenticationToken, LinkedNotebook linkedNotebook, i32 afterUSN, i32 maxEntries, bool fullSyncOnly)'\n  print '   listNotebooks(string authenticationToken)'\n  print '  Notebook getNotebook(string authenticationToken, Guid guid)'\n  print '  Notebook getDefaultNotebook(string authenticationToken)'\n  print '  Notebook createNotebook(string authenticationToken, Notebook notebook)'\n  print '  i32 updateNotebook(string authenticationToken, Notebook notebook)'\n  print '  i32 expungeNotebook(string authenticationToken, Guid guid)'\n  print '   listTags(string authenticationToken)'\n  print '   listTagsByNotebook(string authenticationToken, Guid notebookGuid)'\n  print '  Tag getTag(string authenticationToken, Guid guid)'\n  print '  Tag createTag(string authenticationToken, Tag tag)'\n  print '  i32 updateTag(string authenticationToken, Tag tag)'\n  print '  void untagAll(string authenticationToken, Guid guid)'\n  print '  i32 expungeTag(string authenticationToken, Guid guid)'\n  print '   listSearches(string authenticationToken)'\n  print '  SavedSearch getSearch(string authenticationToken, Guid guid)'\n  print '  SavedSearch createSearch(string authenticationToken, SavedSearch search)'\n  print '  i32 updateSearch(string authenticationToken, SavedSearch search)'\n  print '  i32 expungeSearch(string authenticationToken, Guid guid)'\n  print '  NoteList findNotes(string authenticationToken, NoteFilter filter, i32 offset, i32 maxNotes)'\n  print '  i32 findNoteOffset(string authenticationToken, NoteFilter filter, Guid guid)'\n  print '  NotesMetadataList findNotesMetadata(string authenticationToken, NoteFilter filter, i32 offset, i32 maxNotes, NotesMetadataResultSpec resultSpec)'\n  print '  NoteCollectionCounts findNoteCounts(string authenticationToken, NoteFilter filter, bool withTrash)'\n  print '  Note getNote(string authenticationToken, Guid guid, bool withContent, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData)'\n  print '  LazyMap getNoteApplicationData(string authenticationToken, Guid guid)'\n  print '  string getNoteApplicationDataEntry(string authenticationToken, Guid guid, string key)'\n  print '  i32 setNoteApplicationDataEntry(string authenticationToken, Guid guid, string key, string value)'\n  print '  i32 unsetNoteApplicationDataEntry(string authenticationToken, Guid guid, string key)'\n  print '  string getNoteContent(string authenticationToken, Guid guid)'\n  print '  string getNoteSearchText(string authenticationToken, Guid guid, bool noteOnly, bool tokenizeForIndexing)'\n  print '  string getResourceSearchText(string authenticationToken, Guid guid)'\n  print '   getNoteTagNames(string authenticationToken, Guid guid)'\n  print '  Note createNote(string authenticationToken, Note note)'\n  print '  Note updateNote(string authenticationToken, Note note)'\n  print '  i32 deleteNote(string authenticationToken, Guid guid)'\n  print '  i32 expungeNote(string authenticationToken, Guid guid)'\n  print '  i32 expungeNotes(string authenticationToken,  noteGuids)'\n  print '  i32 expungeInactiveNotes(string authenticationToken)'\n  print '  Note copyNote(string authenticationToken, Guid noteGuid, Guid toNotebookGuid)'\n  print '   listNoteVersions(string authenticationToken, Guid noteGuid)'\n  print '  Note getNoteVersion(string authenticationToken, Guid noteGuid, i32 updateSequenceNum, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData)'\n  print '  Resource getResource(string authenticationToken, Guid guid, bool withData, bool withRecognition, bool withAttributes, bool withAlternateData)'\n  print '  LazyMap getResourceApplicationData(string authenticationToken, Guid guid)'\n  print '  string getResourceApplicationDataEntry(string authenticationToken, Guid guid, string key)'\n  print '  i32 setResourceApplicationDataEntry(string authenticationToken, Guid guid, string key, string value)'\n  print '  i32 unsetResourceApplicationDataEntry(string authenticationToken, Guid guid, string key)'\n  print '  i32 updateResource(string authenticationToken, Resource resource)'\n  print '  string getResourceData(string authenticationToken, Guid guid)'\n  print '  Resource getResourceByHash(string authenticationToken, Guid noteGuid, string contentHash, bool withData, bool withRecognition, bool withAlternateData)'\n  print '  string getResourceRecognition(string authenticationToken, Guid guid)'\n  print '  string getResourceAlternateData(string authenticationToken, Guid guid)'\n  print '  ResourceAttributes getResourceAttributes(string authenticationToken, Guid guid)'\n  print '  Notebook getPublicNotebook(UserID userId, string publicUri)'\n  print '  SharedNotebook createSharedNotebook(string authenticationToken, SharedNotebook sharedNotebook)'\n  print '  i32 updateSharedNotebook(string authenticationToken, SharedNotebook sharedNotebook)'\n  print '  i32 setSharedNotebookRecipientSettings(string authenticationToken, i64 sharedNotebookId, SharedNotebookRecipientSettings recipientSettings)'\n  print '  i32 sendMessageToSharedNotebookMembers(string authenticationToken, Guid notebookGuid, string messageText,  recipients)'\n  print '   listSharedNotebooks(string authenticationToken)'\n  print '  i32 expungeSharedNotebooks(string authenticationToken,  sharedNotebookIds)'\n  print '  LinkedNotebook createLinkedNotebook(string authenticationToken, LinkedNotebook linkedNotebook)'\n  print '  i32 updateLinkedNotebook(string authenticationToken, LinkedNotebook linkedNotebook)'\n  print '   listLinkedNotebooks(string authenticationToken)'\n  print '  i32 expungeLinkedNotebook(string authenticationToken, Guid guid)'\n  print '  AuthenticationResult authenticateToSharedNotebook(string shareKey, string authenticationToken)'\n  print '  SharedNotebook getSharedNotebookByAuth(string authenticationToken)'\n  print '  void emailNote(string authenticationToken, NoteEmailParameters parameters)'\n  print '  string shareNote(string authenticationToken, Guid guid)'\n  print '  void stopSharingNote(string authenticationToken, Guid guid)'\n  print '  AuthenticationResult authenticateToSharedNote(string guid, string noteKey, string authenticationToken)'\n  print '  RelatedResult findRelated(string authenticationToken, RelatedQuery query, RelatedResultSpec resultSpec)'\n  print ''\n  sys.exit(0)\n\npp = pprint.PrettyPrinter(indent = 2)\nhost = 'localhost'\nport = 9090\nuri = ''\nframed = False\nhttp = False\nargi = 1\n\nif sys.argv[argi] == '-h':\n  parts = sys.argv[argi+1].split(':')\n  host = parts[0]\n  if len(parts) > 1:\n    port = int(parts[1])\n  argi += 2\n\nif sys.argv[argi] == '-u':\n  url = urlparse(sys.argv[argi+1])\n  parts = url[1].split(':')\n  host = parts[0]\n  if len(parts) > 1:\n    port = int(parts[1])\n  else:\n    port = 80\n  uri = url[2]\n  if url[4]:\n    uri += '?%s' % url[4]\n  http = True\n  argi += 2\n\nif sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':\n  framed = True\n  argi += 1\n\ncmd = sys.argv[argi]\nargs = sys.argv[argi+1:]\n\nif http:\n  transport = THttpClient.THttpClient(host, port, uri)\nelse:\n  socket = TSocket.TSocket(host, port)\n  if framed:\n    transport = TTransport.TFramedTransport(socket)\n  else:\n    transport = TTransport.TBufferedTransport(socket)\nprotocol = TBinaryProtocol.TBinaryProtocol(transport)\nclient = NoteStore.Client(protocol)\ntransport.open()\n\nif cmd == 'getSyncState':\n  if len(args) != 1:\n    print 'getSyncState requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.getSyncState(args[0],))\n\nelif cmd == 'getSyncStateWithMetrics':\n  if len(args) != 2:\n    print 'getSyncStateWithMetrics requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getSyncStateWithMetrics(args[0],eval(args[1]),))\n\nelif cmd == 'getSyncChunk':\n  if len(args) != 4:\n    print 'getSyncChunk requires 4 args'\n    sys.exit(1)\n  pp.pprint(client.getSyncChunk(args[0],eval(args[1]),eval(args[2]),eval(args[3]),))\n\nelif cmd == 'getFilteredSyncChunk':\n  if len(args) != 4:\n    print 'getFilteredSyncChunk requires 4 args'\n    sys.exit(1)\n  pp.pprint(client.getFilteredSyncChunk(args[0],eval(args[1]),eval(args[2]),eval(args[3]),))\n\nelif cmd == 'getLinkedNotebookSyncState':\n  if len(args) != 2:\n    print 'getLinkedNotebookSyncState requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getLinkedNotebookSyncState(args[0],eval(args[1]),))\n\nelif cmd == 'getLinkedNotebookSyncChunk':\n  if len(args) != 5:\n    print 'getLinkedNotebookSyncChunk requires 5 args'\n    sys.exit(1)\n  pp.pprint(client.getLinkedNotebookSyncChunk(args[0],eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))\n\nelif cmd == 'listNotebooks':\n  if len(args) != 1:\n    print 'listNotebooks requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.listNotebooks(args[0],))\n\nelif cmd == 'getNotebook':\n  if len(args) != 2:\n    print 'getNotebook requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getNotebook(args[0],eval(args[1]),))\n\nelif cmd == 'getDefaultNotebook':\n  if len(args) != 1:\n    print 'getDefaultNotebook requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.getDefaultNotebook(args[0],))\n\nelif cmd == 'createNotebook':\n  if len(args) != 2:\n    print 'createNotebook requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.createNotebook(args[0],eval(args[1]),))\n\nelif cmd == 'updateNotebook':\n  if len(args) != 2:\n    print 'updateNotebook requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.updateNotebook(args[0],eval(args[1]),))\n\nelif cmd == 'expungeNotebook':\n  if len(args) != 2:\n    print 'expungeNotebook requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.expungeNotebook(args[0],eval(args[1]),))\n\nelif cmd == 'listTags':\n  if len(args) != 1:\n    print 'listTags requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.listTags(args[0],))\n\nelif cmd == 'listTagsByNotebook':\n  if len(args) != 2:\n    print 'listTagsByNotebook requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.listTagsByNotebook(args[0],eval(args[1]),))\n\nelif cmd == 'getTag':\n  if len(args) != 2:\n    print 'getTag requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getTag(args[0],eval(args[1]),))\n\nelif cmd == 'createTag':\n  if len(args) != 2:\n    print 'createTag requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.createTag(args[0],eval(args[1]),))\n\nelif cmd == 'updateTag':\n  if len(args) != 2:\n    print 'updateTag requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.updateTag(args[0],eval(args[1]),))\n\nelif cmd == 'untagAll':\n  if len(args) != 2:\n    print 'untagAll requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.untagAll(args[0],eval(args[1]),))\n\nelif cmd == 'expungeTag':\n  if len(args) != 2:\n    print 'expungeTag requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.expungeTag(args[0],eval(args[1]),))\n\nelif cmd == 'listSearches':\n  if len(args) != 1:\n    print 'listSearches requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.listSearches(args[0],))\n\nelif cmd == 'getSearch':\n  if len(args) != 2:\n    print 'getSearch requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getSearch(args[0],eval(args[1]),))\n\nelif cmd == 'createSearch':\n  if len(args) != 2:\n    print 'createSearch requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.createSearch(args[0],eval(args[1]),))\n\nelif cmd == 'updateSearch':\n  if len(args) != 2:\n    print 'updateSearch requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.updateSearch(args[0],eval(args[1]),))\n\nelif cmd == 'expungeSearch':\n  if len(args) != 2:\n    print 'expungeSearch requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.expungeSearch(args[0],eval(args[1]),))\n\nelif cmd == 'findNotes':\n  if len(args) != 4:\n    print 'findNotes requires 4 args'\n    sys.exit(1)\n  pp.pprint(client.findNotes(args[0],eval(args[1]),eval(args[2]),eval(args[3]),))\n\nelif cmd == 'findNoteOffset':\n  if len(args) != 3:\n    print 'findNoteOffset requires 3 args'\n    sys.exit(1)\n  pp.pprint(client.findNoteOffset(args[0],eval(args[1]),eval(args[2]),))\n\nelif cmd == 'findNotesMetadata':\n  if len(args) != 5:\n    print 'findNotesMetadata requires 5 args'\n    sys.exit(1)\n  pp.pprint(client.findNotesMetadata(args[0],eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))\n\nelif cmd == 'findNoteCounts':\n  if len(args) != 3:\n    print 'findNoteCounts requires 3 args'\n    sys.exit(1)\n  pp.pprint(client.findNoteCounts(args[0],eval(args[1]),eval(args[2]),))\n\nelif cmd == 'getNote':\n  if len(args) != 6:\n    print 'getNote requires 6 args'\n    sys.exit(1)\n  pp.pprint(client.getNote(args[0],eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),eval(args[5]),))\n\nelif cmd == 'getNoteApplicationData':\n  if len(args) != 2:\n    print 'getNoteApplicationData requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getNoteApplicationData(args[0],eval(args[1]),))\n\nelif cmd == 'getNoteApplicationDataEntry':\n  if len(args) != 3:\n    print 'getNoteApplicationDataEntry requires 3 args'\n    sys.exit(1)\n  pp.pprint(client.getNoteApplicationDataEntry(args[0],eval(args[1]),args[2],))\n\nelif cmd == 'setNoteApplicationDataEntry':\n  if len(args) != 4:\n    print 'setNoteApplicationDataEntry requires 4 args'\n    sys.exit(1)\n  pp.pprint(client.setNoteApplicationDataEntry(args[0],eval(args[1]),args[2],args[3],))\n\nelif cmd == 'unsetNoteApplicationDataEntry':\n  if len(args) != 3:\n    print 'unsetNoteApplicationDataEntry requires 3 args'\n    sys.exit(1)\n  pp.pprint(client.unsetNoteApplicationDataEntry(args[0],eval(args[1]),args[2],))\n\nelif cmd == 'getNoteContent':\n  if len(args) != 2:\n    print 'getNoteContent requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getNoteContent(args[0],eval(args[1]),))\n\nelif cmd == 'getNoteSearchText':\n  if len(args) != 4:\n    print 'getNoteSearchText requires 4 args'\n    sys.exit(1)\n  pp.pprint(client.getNoteSearchText(args[0],eval(args[1]),eval(args[2]),eval(args[3]),))\n\nelif cmd == 'getResourceSearchText':\n  if len(args) != 2:\n    print 'getResourceSearchText requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getResourceSearchText(args[0],eval(args[1]),))\n\nelif cmd == 'getNoteTagNames':\n  if len(args) != 2:\n    print 'getNoteTagNames requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getNoteTagNames(args[0],eval(args[1]),))\n\nelif cmd == 'createNote':\n  if len(args) != 2:\n    print 'createNote requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.createNote(args[0],eval(args[1]),))\n\nelif cmd == 'updateNote':\n  if len(args) != 2:\n    print 'updateNote requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.updateNote(args[0],eval(args[1]),))\n\nelif cmd == 'deleteNote':\n  if len(args) != 2:\n    print 'deleteNote requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.deleteNote(args[0],eval(args[1]),))\n\nelif cmd == 'expungeNote':\n  if len(args) != 2:\n    print 'expungeNote requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.expungeNote(args[0],eval(args[1]),))\n\nelif cmd == 'expungeNotes':\n  if len(args) != 2:\n    print 'expungeNotes requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.expungeNotes(args[0],eval(args[1]),))\n\nelif cmd == 'expungeInactiveNotes':\n  if len(args) != 1:\n    print 'expungeInactiveNotes requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.expungeInactiveNotes(args[0],))\n\nelif cmd == 'copyNote':\n  if len(args) != 3:\n    print 'copyNote requires 3 args'\n    sys.exit(1)\n  pp.pprint(client.copyNote(args[0],eval(args[1]),eval(args[2]),))\n\nelif cmd == 'listNoteVersions':\n  if len(args) != 2:\n    print 'listNoteVersions requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.listNoteVersions(args[0],eval(args[1]),))\n\nelif cmd == 'getNoteVersion':\n  if len(args) != 6:\n    print 'getNoteVersion requires 6 args'\n    sys.exit(1)\n  pp.pprint(client.getNoteVersion(args[0],eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),eval(args[5]),))\n\nelif cmd == 'getResource':\n  if len(args) != 6:\n    print 'getResource requires 6 args'\n    sys.exit(1)\n  pp.pprint(client.getResource(args[0],eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),eval(args[5]),))\n\nelif cmd == 'getResourceApplicationData':\n  if len(args) != 2:\n    print 'getResourceApplicationData requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getResourceApplicationData(args[0],eval(args[1]),))\n\nelif cmd == 'getResourceApplicationDataEntry':\n  if len(args) != 3:\n    print 'getResourceApplicationDataEntry requires 3 args'\n    sys.exit(1)\n  pp.pprint(client.getResourceApplicationDataEntry(args[0],eval(args[1]),args[2],))\n\nelif cmd == 'setResourceApplicationDataEntry':\n  if len(args) != 4:\n    print 'setResourceApplicationDataEntry requires 4 args'\n    sys.exit(1)\n  pp.pprint(client.setResourceApplicationDataEntry(args[0],eval(args[1]),args[2],args[3],))\n\nelif cmd == 'unsetResourceApplicationDataEntry':\n  if len(args) != 3:\n    print 'unsetResourceApplicationDataEntry requires 3 args'\n    sys.exit(1)\n  pp.pprint(client.unsetResourceApplicationDataEntry(args[0],eval(args[1]),args[2],))\n\nelif cmd == 'updateResource':\n  if len(args) != 2:\n    print 'updateResource requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.updateResource(args[0],eval(args[1]),))\n\nelif cmd == 'getResourceData':\n  if len(args) != 2:\n    print 'getResourceData requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getResourceData(args[0],eval(args[1]),))\n\nelif cmd == 'getResourceByHash':\n  if len(args) != 6:\n    print 'getResourceByHash requires 6 args'\n    sys.exit(1)\n  pp.pprint(client.getResourceByHash(args[0],eval(args[1]),args[2],eval(args[3]),eval(args[4]),eval(args[5]),))\n\nelif cmd == 'getResourceRecognition':\n  if len(args) != 2:\n    print 'getResourceRecognition requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getResourceRecognition(args[0],eval(args[1]),))\n\nelif cmd == 'getResourceAlternateData':\n  if len(args) != 2:\n    print 'getResourceAlternateData requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getResourceAlternateData(args[0],eval(args[1]),))\n\nelif cmd == 'getResourceAttributes':\n  if len(args) != 2:\n    print 'getResourceAttributes requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getResourceAttributes(args[0],eval(args[1]),))\n\nelif cmd == 'getPublicNotebook':\n  if len(args) != 2:\n    print 'getPublicNotebook requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.getPublicNotebook(eval(args[0]),args[1],))\n\nelif cmd == 'createSharedNotebook':\n  if len(args) != 2:\n    print 'createSharedNotebook requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.createSharedNotebook(args[0],eval(args[1]),))\n\nelif cmd == 'updateSharedNotebook':\n  if len(args) != 2:\n    print 'updateSharedNotebook requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.updateSharedNotebook(args[0],eval(args[1]),))\n\nelif cmd == 'setSharedNotebookRecipientSettings':\n  if len(args) != 3:\n    print 'setSharedNotebookRecipientSettings requires 3 args'\n    sys.exit(1)\n  pp.pprint(client.setSharedNotebookRecipientSettings(args[0],eval(args[1]),eval(args[2]),))\n\nelif cmd == 'sendMessageToSharedNotebookMembers':\n  if len(args) != 4:\n    print 'sendMessageToSharedNotebookMembers requires 4 args'\n    sys.exit(1)\n  pp.pprint(client.sendMessageToSharedNotebookMembers(args[0],eval(args[1]),args[2],eval(args[3]),))\n\nelif cmd == 'listSharedNotebooks':\n  if len(args) != 1:\n    print 'listSharedNotebooks requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.listSharedNotebooks(args[0],))\n\nelif cmd == 'expungeSharedNotebooks':\n  if len(args) != 2:\n    print 'expungeSharedNotebooks requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.expungeSharedNotebooks(args[0],eval(args[1]),))\n\nelif cmd == 'createLinkedNotebook':\n  if len(args) != 2:\n    print 'createLinkedNotebook requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.createLinkedNotebook(args[0],eval(args[1]),))\n\nelif cmd == 'updateLinkedNotebook':\n  if len(args) != 2:\n    print 'updateLinkedNotebook requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.updateLinkedNotebook(args[0],eval(args[1]),))\n\nelif cmd == 'listLinkedNotebooks':\n  if len(args) != 1:\n    print 'listLinkedNotebooks requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.listLinkedNotebooks(args[0],))\n\nelif cmd == 'expungeLinkedNotebook':\n  if len(args) != 2:\n    print 'expungeLinkedNotebook requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.expungeLinkedNotebook(args[0],eval(args[1]),))\n\nelif cmd == 'authenticateToSharedNotebook':\n  if len(args) != 2:\n    print 'authenticateToSharedNotebook requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.authenticateToSharedNotebook(args[0],args[1],))\n\nelif cmd == 'getSharedNotebookByAuth':\n  if len(args) != 1:\n    print 'getSharedNotebookByAuth requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.getSharedNotebookByAuth(args[0],))\n\nelif cmd == 'emailNote':\n  if len(args) != 2:\n    print 'emailNote requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.emailNote(args[0],eval(args[1]),))\n\nelif cmd == 'shareNote':\n  if len(args) != 2:\n    print 'shareNote requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.shareNote(args[0],eval(args[1]),))\n\nelif cmd == 'stopSharingNote':\n  if len(args) != 2:\n    print 'stopSharingNote requires 2 args'\n    sys.exit(1)\n  pp.pprint(client.stopSharingNote(args[0],eval(args[1]),))\n\nelif cmd == 'authenticateToSharedNote':\n  if len(args) != 3:\n    print 'authenticateToSharedNote requires 3 args'\n    sys.exit(1)\n  pp.pprint(client.authenticateToSharedNote(args[0],args[1],args[2],))\n\nelif cmd == 'findRelated':\n  if len(args) != 3:\n    print 'findRelated requires 3 args'\n    sys.exit(1)\n  pp.pprint(client.findRelated(args[0],eval(args[1]),eval(args[2]),))\n\nelse:\n  print 'Unrecognized method %s' % cmd\n  sys.exit(1)\n\ntransport.close()\n"
  },
  {
    "path": "lib/evernote/edam/notestore/NoteStore.py",
    "content": "#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nfrom ttypes import *\nfrom thrift.Thrift import TProcessor\nfrom thrift.transport import TTransport\nfrom thrift.protocol import TBinaryProtocol, TProtocol\ntry:\n  from thrift.protocol import fastbinary\nexcept:\n  fastbinary = None\n\n\nclass Iface(object):\n  def getSyncState(self, authenticationToken):\n    \"\"\"\n    Asks the NoteStore to provide information about the status of the user\n    account corresponding to the provided authentication token.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def getSyncStateWithMetrics(self, authenticationToken, clientMetrics):\n    \"\"\"\n    Asks the NoteStore to provide information about the status of the user\n    account corresponding to the provided authentication token.\n    This version of 'getSyncState' allows the client to upload coarse-\n    grained usage metrics to the service.\n    \n    @param clientMetrics  see the documentation of the ClientUsageMetrics\n      structure for an explanation of the fields that clients can pass to\n      the service.\n    \n    Parameters:\n     - authenticationToken\n     - clientMetrics\n    \"\"\"\n    pass\n\n  def getSyncChunk(self, authenticationToken, afterUSN, maxEntries, fullSyncOnly):\n    \"\"\"\n    DEPRECATED - use getFilteredSyncChunk.\n    \n    Parameters:\n     - authenticationToken\n     - afterUSN\n     - maxEntries\n     - fullSyncOnly\n    \"\"\"\n    pass\n\n  def getFilteredSyncChunk(self, authenticationToken, afterUSN, maxEntries, filter):\n    \"\"\"\n    Asks the NoteStore to provide the state of the account in order of\n    last modification.  This request retrieves one block of the server's\n    state so that a client can make several small requests against a large\n    account rather than getting the entire state in one big message.\n    This call gives fine-grained control of the data that will\n    be received by a client by omitting data elements that a client doesn't\n    need. This may reduce network traffic and sync times.\n    \n    @param afterUSN\n      The client can pass this value to ask only for objects that\n      have been updated after a certain point.  This allows the client to\n      receive updates after its last checkpoint rather than doing a full\n      synchronization on every pass.  The default value of \"0\" indicates\n      that the client wants to get objects from the start of the account.\n    \n    @param maxEntries\n      The maximum number of modified objects that should be\n      returned in the result SyncChunk.  This can be used to limit the size\n      of each individual message to be friendly for network transfer.\n    \n    @param filter\n      The caller must set some of the flags in this structure to specify which\n      data types should be returned during the synchronization.  See\n      the SyncChunkFilter structure for information on each flag.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"afterUSN\" - if negative\n      </li>\n      <li> BAD_DATA_FORMAT \"maxEntries\" - if less than 1\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - afterUSN\n     - maxEntries\n     - filter\n    \"\"\"\n    pass\n\n  def getLinkedNotebookSyncState(self, authenticationToken, linkedNotebook):\n    \"\"\"\n    Asks the NoteStore to provide information about the status of a linked\n    notebook that has been shared with the caller, or that is public to the\n    world.\n    This will return a result that is similar to getSyncState, but may omit\n    SyncState.uploaded if the caller doesn't have permission to write to\n    the linked notebook.\n    \n    This function must be called on the shard that owns the referenced\n    notebook.  (I.e. the shardId in /shard/shardId/edam/note must be the\n    same as LinkedNotebook.shardId.)\n    \n    @param authenticationToken\n      This should be an authenticationToken for the guest who has received\n      the invitation to the share.  (I.e. this should not be the result of\n      NoteStore.authenticateToSharedNotebook)\n    \n    @param linkedNotebook\n      This structure should contain identifying information and permissions\n      to access the notebook in question.\n    \n    Parameters:\n     - authenticationToken\n     - linkedNotebook\n    \"\"\"\n    pass\n\n  def getLinkedNotebookSyncChunk(self, authenticationToken, linkedNotebook, afterUSN, maxEntries, fullSyncOnly):\n    \"\"\"\n    Asks the NoteStore to provide information about the contents of a linked\n    notebook that has been shared with the caller, or that is public to the\n    world.\n    This will return a result that is similar to getSyncChunk, but will only\n    contain entries that are visible to the caller.  I.e. only that particular\n    Notebook will be visible, along with its Notes, and Tags on those Notes.\n    \n    This function must be called on the shard that owns the referenced\n    notebook.  (I.e. the shardId in /shard/shardId/edam/note must be the\n    same as LinkedNotebook.shardId.)\n    \n    @param authenticationToken\n      This should be an authenticationToken for the guest who has received\n      the invitation to the share.  (I.e. this should not be the result of\n      NoteStore.authenticateToSharedNotebook)\n    \n    @param linkedNotebook\n      This structure should contain identifying information and permissions\n      to access the notebook in question.  This must contain the valid fields\n      for either a shared notebook (e.g. shareKey)\n      or a public notebook (e.g. username, uri)\n    \n    @param afterUSN\n      The client can pass this value to ask only for objects that\n      have been updated after a certain point.  This allows the client to\n      receive updates after its last checkpoint rather than doing a full\n      synchronization on every pass.  The default value of \"0\" indicates\n      that the client wants to get objects from the start of the account.\n    \n    @param maxEntries\n      The maximum number of modified objects that should be\n      returned in the result SyncChunk.  This can be used to limit the size\n      of each individual message to be friendly for network transfer.\n      Applications should not request more than 256 objects at a time,\n      and must handle the case where the service returns less than the\n      requested number of objects in a given request even though more\n      objects are available on the service.\n    \n    @param fullSyncOnly\n      If true, then the client only wants initial data for a full sync.\n      In this case, the service will not return any expunged objects,\n      and will not return any Resources, since these are also provided\n      in their corresponding Notes.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"afterUSN\" - if negative\n      </li>\n      <li> BAD_DATA_FORMAT \"maxEntries\" - if less than 1\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"LinkedNotebook\" - if the provided information doesn't match any\n        valid notebook\n      </li>\n      <li> \"LinkedNotebook.uri\" - if the provided public URI doesn't match any\n        valid notebook\n      </li>\n      <li> \"SharedNotebook.id\" - if the provided information indicates a\n         shared notebook that no longer exists\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - linkedNotebook\n     - afterUSN\n     - maxEntries\n     - fullSyncOnly\n    \"\"\"\n    pass\n\n  def listNotebooks(self, authenticationToken):\n    \"\"\"\n    Returns a list of all of the notebooks in the account.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def getNotebook(self, authenticationToken, guid):\n    \"\"\"\n    Returns the current state of the notebook with the provided GUID.\n    The notebook may be active or deleted (but not expunged).\n    \n    @param guid\n      The GUID of the notebook to be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Notebook.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Notebook\" - private notebook, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - tag not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def getDefaultNotebook(self, authenticationToken):\n    \"\"\"\n    Returns the notebook that should be used to store new notes in the\n    user's account when no other notebooks are specified.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def createNotebook(self, authenticationToken, notebook):\n    \"\"\"\n    Asks the service to make a notebook with the provided name.\n    \n    @param notebook\n      The desired fields for the notebook must be provided on this\n      object.  The name of the notebook must be set, and either the 'active'\n      or 'defaultNotebook' fields may be set by the client at creation.\n      If a notebook exists in the account with the same name (via\n      case-insensitive compare), this will throw an EDAMUserException.\n    \n    @return\n      The newly created Notebook.  The server-side GUID will be\n      saved in this object's 'guid' field.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Notebook.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Notebook.stack\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Publishing.uri\" - if publishing set but bad uri\n      </li>\n      <li> BAD_DATA_FORMAT \"Publishing.publicDescription\" - if too long\n      </li>\n      <li> DATA_CONFLICT \"Notebook.name\" - name already in use\n      </li>\n      <li> DATA_CONFLICT \"Publishing.uri\" - if URI already in use\n      </li>\n      <li> DATA_REQUIRED \"Publishing.uri\" - if publishing set but uri missing\n      </li>\n      <li> LIMIT_REACHED \"Notebook\" - at max number of notebooks\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - notebook\n    \"\"\"\n    pass\n\n  def updateNotebook(self, authenticationToken, notebook):\n    \"\"\"\n    Submits notebook changes to the service.  The provided data must include\n    the notebook's guid field for identification.\n    \n    @param notebook\n      The notebook object containing the requested changes.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Notebook.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Notebook.stack\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Publishing.uri\" - if publishing set but bad uri\n      </li>\n      <li> BAD_DATA_FORMAT \"Publishing.publicDescription\" - if too long\n      </li>\n      <li> DATA_CONFLICT \"Notebook.name\" - name already in use\n      </li>\n      <li> DATA_CONFLICT \"Publishing.uri\" - if URI already in use\n      </li>\n      <li> DATA_REQUIRED \"Publishing.uri\" - if publishing set but uri missing\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - notebook\n    \"\"\"\n    pass\n\n  def expungeNotebook(self, authenticationToken, guid):\n    \"\"\"\n    Permanently removes the notebook from the user's account.\n    After this action, the notebook is no longer available for undeletion, etc.\n    If the notebook contains any Notes, they will be moved to the current\n    default notebook and moved into the trash (i.e. Note.active=false).\n    <p/>\n    NOTE: This function is generally not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param guid\n      The GUID of the notebook to delete.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Notebook.guid\" - if the parameter is missing\n      </li>\n      <li> LIMIT_REACHED \"Notebook\" - trying to expunge the last Notebook\n      </li>\n      <li> PERMISSION_DENIED \"Notebook\" - private notebook, user doesn't own\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def listTags(self, authenticationToken):\n    \"\"\"\n    Returns a list of the tags in the account.  Evernote does not support\n    the undeletion of tags, so this will only include active tags.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def listTagsByNotebook(self, authenticationToken, notebookGuid):\n    \"\"\"\n    Returns a list of the tags that are applied to at least one note within\n    the provided notebook.  If the notebook is public, the authenticationToken\n    may be ignored.\n    \n    @param notebookGuid\n       the GUID of the notebook to use to find tags\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - notebook not found by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - notebookGuid\n    \"\"\"\n    pass\n\n  def getTag(self, authenticationToken, guid):\n    \"\"\"\n    Returns the current state of the Tag with the provided GUID.\n    \n    @param guid\n      The GUID of the tag to be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Tag.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Tag\" - private Tag, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Tag.guid\" - tag not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def createTag(self, authenticationToken, tag):\n    \"\"\"\n    Asks the service to make a tag with a set of information.\n    \n    @param tag\n      The desired list of fields for the tag are specified in this\n      object.  The caller must specify the tag name, and may provide\n      the parentGUID.\n    \n    @return\n      The newly created Tag.  The server-side GUID will be\n      saved in this object.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Tag.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Tag.parentGuid\" - malformed GUID\n      </li>\n      <li> DATA_CONFLICT \"Tag.name\" - name already in use\n      </li>\n      <li> LIMIT_REACHED \"Tag\" - at max number of tags\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Tag.parentGuid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - tag\n    \"\"\"\n    pass\n\n  def updateTag(self, authenticationToken, tag):\n    \"\"\"\n    Submits tag changes to the service.  The provided data must include\n    the tag's guid field for identification.  The service will apply\n    updates to the following tag fields:  name, parentGuid\n    \n    @param tag\n      The tag object containing the requested changes.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Tag.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Tag.parentGuid\" - malformed GUID\n      </li>\n      <li> DATA_CONFLICT \"Tag.name\" - name already in use\n      </li>\n      <li> DATA_CONFLICT \"Tag.parentGuid\" - can't set parent: circular\n      </li>\n      <li> PERMISSION_DENIED \"Tag\" - user doesn't own tag\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Tag.guid\" - tag not found, by GUID\n      </li>\n      <li> \"Tag.parentGuid\" - parent not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - tag\n    \"\"\"\n    pass\n\n  def untagAll(self, authenticationToken, guid):\n    \"\"\"\n    Removes the provided tag from every note that is currently tagged with\n    this tag.  If this operation is successful, the tag will still be in\n    the account, but it will not be tagged on any notes.\n    \n    This function is not indended for use by full synchronizing clients, since\n    it does not provide enough result information to the client to reconcile\n    the local state without performing a follow-up sync from the service.  This\n    is intended for \"thin clients\" that need to efficiently support this as\n    a UI operation.\n    \n    @param guid\n      The GUID of the tag to remove from all notes.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Tag.guid\" - if the guid parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Tag\" - user doesn't own tag\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Tag.guid\" - tag not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def expungeTag(self, authenticationToken, guid):\n    \"\"\"\n    Permanently deletes the tag with the provided GUID, if present.\n    <p/>\n    NOTE: This function is generally not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param guid\n      The GUID of the tag to delete.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Tag.guid\" - if the guid parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Tag\" - user doesn't own tag\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Tag.guid\" - tag not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def listSearches(self, authenticationToken):\n    \"\"\"\n    Returns a list of the searches in the account.  Evernote does not support\n    the undeletion of searches, so this will only include active searches.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def getSearch(self, authenticationToken, guid):\n    \"\"\"\n    Returns the current state of the search with the provided GUID.\n    \n    @param guid\n      The GUID of the search to be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"SavedSearch.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"SavedSearch\" - private Tag, user doesn't own\n      </li>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"SavedSearch.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def createSearch(self, authenticationToken, search):\n    \"\"\"\n    Asks the service to make a saved search with a set of information.\n    \n    @param search\n      The desired list of fields for the search are specified in this\n      object. The caller must specify the name and query for the\n      search, and may optionally specify a search scope.\n      The SavedSearch.format field is ignored by the service.\n    \n    @return\n      The newly created SavedSearch.  The server-side GUID will be\n      saved in this object.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"SavedSearch.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"SavedSearch.query\" - invalid length\n      </li>\n      <li> DATA_CONFLICT \"SavedSearch.name\" - name already in use\n      </li>\n      <li> LIMIT_REACHED \"SavedSearch\" - at max number of searches\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - search\n    \"\"\"\n    pass\n\n  def updateSearch(self, authenticationToken, search):\n    \"\"\"\n    Submits search changes to the service. The provided data must include\n    the search's guid field for identification. The service will apply\n    updates to the following search fields: name, query, and scope.\n    \n    @param search\n      The search object containing the requested changes.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"SavedSearch.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"SavedSearch.query\" - invalid length\n      </li>\n      <li> DATA_CONFLICT \"SavedSearch.name\" - name already in use\n      </li>\n      <li> PERMISSION_DENIED \"SavedSearch\" - user doesn't own tag\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"SavedSearch.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - search\n    \"\"\"\n    pass\n\n  def expungeSearch(self, authenticationToken, guid):\n    \"\"\"\n    Permanently deletes the saved search with the provided GUID, if present.\n    <p/>\n    NOTE: This function is generally not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param guid\n      The GUID of the search to delete.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"SavedSearch.guid\" - if the guid parameter is empty\n      </li>\n      <li> PERMISSION_DENIED \"SavedSearch\" - user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"SavedSearch.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def findNotes(self, authenticationToken, filter, offset, maxNotes):\n    \"\"\"\n    DEPRECATED. Use findNotesMetadata.\n    \n    Parameters:\n     - authenticationToken\n     - filter\n     - offset\n     - maxNotes\n    \"\"\"\n    pass\n\n  def findNoteOffset(self, authenticationToken, filter, guid):\n    \"\"\"\n    Finds the position of a note within a sorted subset of all of the user's\n    notes. This may be useful for thin clients that are displaying a paginated\n    listing of a large account, which need to know where a particular note\n    sits in the list without retrieving all notes first.\n    \n    @param authenticationToken\n      Must be a valid token for the user's account unless the NoteFilter\n      'notebookGuid' is the GUID of a public notebook.\n    \n    @param filter\n      The list of criteria that will constrain the notes to be returned.\n    \n    @param guid\n      The GUID of the note to be retrieved.\n    \n    @return\n      If the note with the provided GUID is found within the matching note\n      list, this will return the offset of that note within that list (where\n      the first offset is 0).  If the note is not found within the set of\n      notes, this will return -1.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"offset\" - not between 0 and EDAM_USER_NOTES_MAX\n      </li>\n      <li> BAD_DATA_FORMAT \"maxNotes\" - not between 0 and EDAM_USER_NOTES_MAX\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.notebookGuid\" - if malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.tagGuids\" - if any are malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.words\" - if search string too long\n      </li>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - not found, by GUID\n      </li>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - filter\n     - guid\n    \"\"\"\n    pass\n\n  def findNotesMetadata(self, authenticationToken, filter, offset, maxNotes, resultSpec):\n    \"\"\"\n    Used to find the high-level information about a set of the notes from a\n    user's account based on various criteria specified via a NoteFilter object.\n    <p/>\n    Web applications that wish to periodically check for new content in a user's\n    Evernote account should consider using webhooks instead of polling this API.\n    See http://dev.evernote.com/documentation/cloud/chapters/polling_notification.php\n    for more information.\n    \n    @param authenticationToken\n      Must be a valid token for the user's account unless the NoteFilter\n      'notebookGuid' is the GUID of a public notebook.\n    \n    @param filter\n      The list of criteria that will constrain the notes to be returned.\n    \n    @param offset\n      The numeric index of the first note to show within the sorted\n      results.  The numbering scheme starts with \"0\".  This can be used for\n      pagination.\n    \n    @param maxNotes\n      The mximum notes to return in this query.  The service will return a set\n      of notes that is no larger than this number, but may return fewer notes\n      if needed.  The NoteList.totalNotes field in the return value will\n      indicate whether there are more values available after the returned set.\n    \n    @param resultSpec\n      This specifies which information should be returned for each matching\n      Note. The fields on this structure can be used to eliminate data that\n      the client doesn't need, which will reduce the time and bandwidth\n      to receive and process the reply.\n    \n    @return\n      The list of notes that match the criteria.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"offset\" - not between 0 and EDAM_USER_NOTES_MAX\n      </li>\n      <li> BAD_DATA_FORMAT \"maxNotes\" - not between 0 and EDAM_USER_NOTES_MAX\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.notebookGuid\" - if malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.tagGuids\" - if any are malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.words\" - if search string too long\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - filter\n     - offset\n     - maxNotes\n     - resultSpec\n    \"\"\"\n    pass\n\n  def findNoteCounts(self, authenticationToken, filter, withTrash):\n    \"\"\"\n    This function is used to determine how many notes are found for each\n    notebook and tag in the user's account, given a current set of filter\n    parameters that determine the current selection.  This function will\n    return a structure that gives the note count for each notebook and tag\n    that has at least one note under the requested filter.  Any notebook or\n    tag that has zero notes in the filtered set will not be listed in the\n    reply to this function (so they can be assumed to be 0).\n    \n    @param authenticationToken\n      Must be a valid token for the user's account unless the NoteFilter\n      'notebookGuid' is the GUID of a public notebook.\n    \n    @param filter\n      The note selection filter that is currently being applied.  The note\n      counts are to be calculated with this filter applied to the total set\n      of notes in the user's account.\n    \n    @param withTrash\n      If true, then the NoteCollectionCounts.trashCount will be calculated\n      and supplied in the reply. Otherwise, the trash value will be omitted.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"NoteFilter.notebookGuid\" - if malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.notebookGuids\" - if any are malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.words\" - if search string too long\n      </li>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - filter\n     - withTrash\n    \"\"\"\n    pass\n\n  def getNote(self, authenticationToken, guid, withContent, withResourcesData, withResourcesRecognition, withResourcesAlternateData):\n    \"\"\"\n    Returns the current state of the note in the service with the provided\n    GUID.  The ENML contents of the note will only be provided if the\n    'withContent' parameter is true.  The service will include the meta-data\n    for each resource in the note, but the binary contents of the resources\n    and their recognition data will be omitted.\n    If the Note is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).  The applicationData\n    fields are returned as keysOnly.\n    \n    @param guid\n      The GUID of the note to be retrieved.\n    \n    @param withContent\n      If true, the note will include the ENML contents of its\n      'content' field.\n    \n    @param withResourcesData\n      If true, any Resource elements in this Note will include the binary\n      contents of their 'data' field's body.\n    \n    @param withResourcesRecognition\n      If true, any Resource elements will include the binary contents of the\n      'recognition' field's body if recognition data is present.\n    \n    @param withResourcesAlternateData\n      If true, any Resource elements in this Note will include the binary\n      contents of their 'alternateData' fields' body, if an alternate form\n      is present.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - withContent\n     - withResourcesData\n     - withResourcesRecognition\n     - withResourcesAlternateData\n    \"\"\"\n    pass\n\n  def getNoteApplicationData(self, authenticationToken, guid):\n    \"\"\"\n    Get all of the application data for the note identified by GUID,\n    with values returned within the LazyMap fullMap field.\n    If there are no applicationData entries, then a LazyMap\n    with an empty fullMap will be returned. If your application\n    only needs to fetch its own applicationData entry, use\n    getNoteApplicationDataEntry instead.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def getNoteApplicationDataEntry(self, authenticationToken, guid, key):\n    \"\"\"\n    Get the value of a single entry in the applicationData map\n    for the note identified by GUID.\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - note not found, by GUID</li>\n      <li> \"NoteAttributes.applicationData.key\" - note not found, by key</li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - key\n    \"\"\"\n    pass\n\n  def setNoteApplicationDataEntry(self, authenticationToken, guid, key, value):\n    \"\"\"\n    Update, or create, an entry in the applicationData map for\n    the note identified by guid.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - key\n     - value\n    \"\"\"\n    pass\n\n  def unsetNoteApplicationDataEntry(self, authenticationToken, guid, key):\n    \"\"\"\n    Remove an entry identified by 'key' from the applicationData map for\n    the note identified by 'guid'. Silently ignores an unset of a\n    non-existing key.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - key\n    \"\"\"\n    pass\n\n  def getNoteContent(self, authenticationToken, guid):\n    \"\"\"\n    Returns XHTML contents of the note with the provided GUID.\n    If the Note is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).\n    \n    @param guid\n      The GUID of the note to be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def getNoteSearchText(self, authenticationToken, guid, noteOnly, tokenizeForIndexing):\n    \"\"\"\n    Returns a block of the extracted plain text contents of the note with the\n    provided GUID.  This text can be indexed for search purposes by a light\n    client that doesn't have capabilities to extract all of the searchable\n    text content from the note and its resources.\n    \n    If the Note is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).\n    \n    @param guid\n      The GUID of the note to be retrieved.\n    \n    @param noteOnly\n      If true, this will only return the text extracted from the ENML contents\n      of the note itself.  If false, this will also include the extracted text\n      from any text-bearing resources (PDF, recognized images)\n    \n    @param tokenizeForIndexing\n      If true, this will break the text into cleanly separated and sanitized\n      tokens.  If false, this will return the more raw text extraction, with\n      its original punctuation, capitalization, spacing, etc.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - noteOnly\n     - tokenizeForIndexing\n    \"\"\"\n    pass\n\n  def getResourceSearchText(self, authenticationToken, guid):\n    \"\"\"\n    Returns a block of the extracted plain text contents of the resource with\n    the provided GUID.  This text can be indexed for search purposes by a light\n    client that doesn't have capability to extract all of the searchable\n    text content from a resource.\n    \n    If the Resource is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).\n    \n    @param guid\n      The GUID of the resource to be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def getNoteTagNames(self, authenticationToken, guid):\n    \"\"\"\n    Returns a list of the names of the tags for the note with the provided\n    guid.  This can be used with authentication to get the tags for a\n    user's own note, or can be used without valid authentication to retrieve\n    the names of the tags for a note in a public notebook.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def createNote(self, authenticationToken, note):\n    \"\"\"\n    Asks the service to make a note with the provided set of information.\n    \n    @param note\n      A Note object containing the desired fields to be populated on\n      the service.\n    \n    @return\n      The newly created Note from the service.  The server-side\n      GUIDs for the Note and any Resources will be saved in this object.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.title\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Note.content\" - invalid length for ENML content\n      </li>\n      <li> BAD_DATA_FORMAT \"Resource.mime\" - invalid resource MIME type\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteAttributes.*\" - bad resource string\n      </li>\n      <li> BAD_DATA_FORMAT \"ResourceAttributes.*\" - bad resource string\n      </li>\n      <li> DATA_CONFLICT \"Note.deleted\" - deleted time set on active note\n      </li>\n      <li> DATA_REQUIRED \"Resource.data\" - resource data body missing\n      </li>\n      <li> ENML_VALIDATION \"*\" - note content doesn't validate against DTD\n      </li>\n      <li> LIMIT_REACHED \"Note\" - at max number per account\n      </li>\n      <li> LIMIT_REACHED \"Note.size\" - total note size too large\n      </li>\n      <li> LIMIT_REACHED \"Note.resources\" - too many resources on Note\n      </li>\n      <li> LIMIT_REACHED \"Note.tagGuids\" - too many Tags on Note\n      </li>\n      <li> LIMIT_REACHED \"Resource.data.size\" - resource too large\n      </li>\n      <li> LIMIT_REACHED \"NoteAttribute.*\" - attribute string too long\n      </li>\n      <li> LIMIT_REACHED \"ResourceAttribute.*\" - attribute string too long\n      </li>\n      <li> PERMISSION_DENIED \"Note.notebookGuid\" - NB not owned by user\n      </li>\n      <li> QUOTA_REACHED \"Accounting.uploadLimit\" - note exceeds upload quota\n      </li>\n      <li> BAD_DATA_FORMAT \"Tag.name\" - Note.tagNames was provided, and one\n        of the specified tags had an invalid length or pattern\n      </li>\n      <li> LIMIT_REACHED \"Tag\" - Note.tagNames was provided, and the required\n        new tags would exceed the maximum number per account\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.notebookGuid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - note\n    \"\"\"\n    pass\n\n  def updateNote(self, authenticationToken, note):\n    \"\"\"\n    Submit a set of changes to a note to the service.  The provided data\n    must include the note's guid field for identification. The note's\n    title must also be set.\n    \n    @param note\n      A Note object containing the desired fields to be populated on\n      the service. With the exception of the note's title and guid, fields\n      that are not being changed do not need to be set. If the content is not\n      being modified, note.content should be left unset. If the list of\n      resources is not being modified, note.resources should be left unset.\n    \n    @return\n      The metadata (no contents) for the Note on the server after the update\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.title\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Note.content\" - invalid length for ENML body\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteAttributes.*\" - bad resource string\n      </li>\n      <li> BAD_DATA_FORMAT \"ResourceAttributes.*\" - bad resource string\n      </li>\n      <li> BAD_DATA_FORMAT \"Resource.mime\" - invalid resource MIME type\n      </li>\n      <li> DATA_CONFLICT \"Note.deleted\" - deleted time set on active note\n      </li>\n      <li> DATA_REQUIRED \"Resource.data\" - resource data body missing\n      </li>\n      <li> ENML_VALIDATION \"*\" - note content doesn't validate against DTD\n      </li>\n      <li> LIMIT_REACHED \"Note.tagGuids\" - too many Tags on Note\n      </li>\n      <li> LIMIT_REACHED \"Note.resources\" - too many resources on Note\n      </li>\n      <li> LIMIT_REACHED \"Note.size\" - total note size too large\n      </li>\n      <li> LIMIT_REACHED \"Resource.data.size\" - resource too large\n      </li>\n      <li> LIMIT_REACHED \"NoteAttribute.*\" - attribute string too long\n      </li>\n      <li> LIMIT_REACHED \"ResourceAttribute.*\" - attribute string too long\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - user doesn't own\n      </li>\n      <li> PERMISSION_DENIED \"Note.notebookGuid\" - user doesn't own destination\n      </li>\n      <li> QUOTA_REACHED \"Accounting.uploadLimit\" - note exceeds upload quota\n      </li>\n      <li> BAD_DATA_FORMAT \"Tag.name\" - Note.tagNames was provided, and one\n        of the specified tags had an invalid length or pattern\n      </li>\n      <li> LIMIT_REACHED \"Tag\" - Note.tagNames was provided, and the required\n        new tags would exceed the maximum number per account\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - note not found, by GUID\n      </li>\n      <li> \"Note.notebookGuid\" - if notebookGuid provided, but not found\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - note\n    \"\"\"\n    pass\n\n  def deleteNote(self, authenticationToken, guid):\n    \"\"\"\n    Moves the note into the trash. The note may still be undeleted, unless it\n    is expunged.  This is equivalent to calling updateNote() after setting\n    Note.active = false\n    \n    @param guid\n      The GUID of the note to delete.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> PERMISSION_DENIED \"Note\" - user doesn't have permission to\n             update the note.\n      </li>\n    </ul>\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_CONFLICT \"Note.guid\" - the note is already deleted\n      </li>\n    </ul>\n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def expungeNote(self, authenticationToken, guid):\n    \"\"\"\n    Permanently removes a Note, and all of its Resources,\n    from the service.\n    <p/>\n    NOTE: This function is not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param guid\n      The GUID of the note to delete.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> PERMISSION_DENIED \"Note\" - user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def expungeNotes(self, authenticationToken, noteGuids):\n    \"\"\"\n    Permanently removes a list of Notes, and all of their Resources, from\n    the service.  This should be invoked with a small number of Note GUIDs\n    (e.g. 100 or less) on each call.  To expunge a larger number of notes,\n    call this method multiple times.  This should also be used to reduce the\n    number of Notes in a notebook before calling expungeNotebook() or\n    in the trash before calling expungeInactiveNotes(), since these calls may\n    be prohibitively slow if there are more than a few hundred notes.\n    If an exception is thrown for any of the GUIDs, then none of the notes\n    will be deleted.  I.e. this call can be treated as an atomic transaction.\n    <p/>\n    NOTE: This function is not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param noteGuids\n      The list of GUIDs for the Notes to remove.\n    \n    @return\n      The account's updateCount at the end of this operation\n    \n    @throws EDAMUserException <ul>\n      <li> PERMISSION_DENIED \"Note\" - user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - noteGuids\n    \"\"\"\n    pass\n\n  def expungeInactiveNotes(self, authenticationToken):\n    \"\"\"\n    Permanently removes all of the Notes that are currently marked as\n    inactive.  This is equivalent to \"emptying the trash\", and these Notes\n    will be gone permanently.\n    <p/>\n    This operation may be relatively slow if the account contains a large\n    number of inactive Notes.\n    <p/>\n    NOTE: This function is not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @return\n       The number of notes that were expunged.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def copyNote(self, authenticationToken, noteGuid, toNotebookGuid):\n    \"\"\"\n    Performs a deep copy of the Note with the provided GUID 'noteGuid' into\n    the Notebook with the provided GUID 'toNotebookGuid'.\n    The caller must be the owner of both the Note and the Notebook.\n    This creates a new Note in the destination Notebook with new content and\n    Resources that match all of the content and Resources from the original\n    Note, but with new GUID identifiers.\n    The original Note is not modified by this operation.\n    The copied note is considered as an \"upload\" for the purpose of upload\n    transfer limit calculation, so its size is added to the upload count for\n    the owner.\n    \n    @param noteGuid\n      The GUID of the Note to copy.\n    \n    @param toNotebookGuid\n      The GUID of the Notebook that should receive the new Note.\n    \n    @return\n      The metadata for the new Note that was created.  This will include the\n      new GUID for this Note (and any copied Resources), but will not include\n      the content body or the binary bodies of any Resources.\n    \n    @throws EDAMUserException <ul>\n      <li> LIMIT_REACHED \"Note\" - at max number per account\n      </li>\n      <li> PERMISSION_DENIED \"Notebook.guid\" - destination not owned by user\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - user doesn't own\n      </li>\n      <li> QUOTA_REACHED \"Accounting.uploadLimit\" - note exceeds upload quota\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - noteGuid\n     - toNotebookGuid\n    \"\"\"\n    pass\n\n  def listNoteVersions(self, authenticationToken, noteGuid):\n    \"\"\"\n    Returns a list of the prior versions of a particular note that are\n    saved within the service.  These prior versions are stored to provide a\n    recovery from unintentional removal of content from a note. The identifiers\n    that are returned by this call can be used with getNoteVersion to retrieve\n    the previous note.\n    The identifiers will be listed from the most recent versions to the oldest.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - noteGuid\n    \"\"\"\n    pass\n\n  def getNoteVersion(self, authenticationToken, noteGuid, updateSequenceNum, withResourcesData, withResourcesRecognition, withResourcesAlternateData):\n    \"\"\"\n    This can be used to retrieve a previous version of a Note after it has been\n    updated within the service.  The caller must identify the note (via its\n    guid) and the version (via the updateSequenceNumber of that version).\n    to find a listing of the stored version USNs for a note, call\n    listNoteVersions.\n    This call is only available for notes in Premium accounts.  (I.e. access\n    to past versions of Notes is a Premium-only feature.)\n    \n    @param noteGuid\n      The GUID of the note to be retrieved.\n    \n    @param updateSequenceNum\n      The USN of the version of the note that is being retrieved\n    \n    @param withResourcesData\n      If true, any Resource elements in this Note will include the binary\n      contents of their 'data' field's body.\n    \n    @param withResourcesRecognition\n      If true, any Resource elements will include the binary contents of the\n      'recognition' field's body if recognition data is present.\n    \n    @param withResourcesAlternateData\n      If true, any Resource elements in this Note will include the binary\n      contents of their 'alternateData' fields' body, if an alternate form\n      is present.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n      <li> PERMISSION_DENIED \"updateSequenceNum\" -\n        The account isn't permitted to access previous versions of notes.\n        (i.e. this is a Free account.)\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n      <li> \"Note.updateSequenceNumber\" - the Note doesn't have a version with\n         the corresponding USN.\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - noteGuid\n     - updateSequenceNum\n     - withResourcesData\n     - withResourcesRecognition\n     - withResourcesAlternateData\n    \"\"\"\n    pass\n\n  def getResource(self, authenticationToken, guid, withData, withRecognition, withAttributes, withAlternateData):\n    \"\"\"\n    Returns the current state of the resource in the service with the\n    provided GUID.\n    If the Resource is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).  Only the\n    keys for the applicationData will be returned.\n    \n    @param guid\n      The GUID of the resource to be retrieved.\n    \n    @param withData\n      If true, the Resource will include the binary contents of the\n      'data' field's body.\n    \n    @param withRecognition\n      If true, the Resource will include the binary contents of the\n      'recognition' field's body if recognition data is present.\n    \n    @param withAttributes\n      If true, the Resource will include the attributes\n    \n    @param withAlternateData\n      If true, the Resource will include the binary contents of the\n      'alternateData' field's body, if an alternate form is present.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - withData\n     - withRecognition\n     - withAttributes\n     - withAlternateData\n    \"\"\"\n    pass\n\n  def getResourceApplicationData(self, authenticationToken, guid):\n    \"\"\"\n    Get all of the application data for the Resource identified by GUID,\n    with values returned within the LazyMap fullMap field.\n    If there are no applicationData entries, then a LazyMap\n    with an empty fullMap will be returned. If your application\n    only needs to fetch its own applicationData entry, use\n    getResourceApplicationDataEntry instead.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def getResourceApplicationDataEntry(self, authenticationToken, guid, key):\n    \"\"\"\n    Get the value of a single entry in the applicationData map\n    for the Resource identified by GUID.\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - Resource not found, by GUID</li>\n      <li> \"ResourceAttributes.applicationData.key\" - Resource not found, by key</li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - key\n    \"\"\"\n    pass\n\n  def setResourceApplicationDataEntry(self, authenticationToken, guid, key, value):\n    \"\"\"\n    Update, or create, an entry in the applicationData map for\n    the Resource identified by guid.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - key\n     - value\n    \"\"\"\n    pass\n\n  def unsetResourceApplicationDataEntry(self, authenticationToken, guid, key):\n    \"\"\"\n    Remove an entry identified by 'key' from the applicationData map for\n    the Resource identified by 'guid'.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - key\n    \"\"\"\n    pass\n\n  def updateResource(self, authenticationToken, resource):\n    \"\"\"\n    Submit a set of changes to a resource to the service.  This can be used\n    to update the meta-data about the resource, but cannot be used to change\n    the binary contents of the resource (including the length and hash).  These\n    cannot be changed directly without creating a new resource and removing the\n    old one via updateNote.\n    \n    @param resource\n      A Resource object containing the desired fields to be populated on\n      the service.  The service will attempt to update the resource with the\n      following fields from the client:\n      <ul>\n         <li>guid:  must be provided to identify the resource\n         </li>\n         <li>mime\n         </li>\n         <li>width\n         </li>\n         <li>height\n         </li>\n         <li>duration\n         </li>\n         <li>attributes:  optional.  if present, the set of attributes will\n              be replaced.\n         </li>\n      </ul>\n    \n    @return\n      The Update Sequence Number of the resource after the changes have been\n      applied.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> BAD_DATA_FORMAT \"Resource.mime\" - invalid resource MIME type\n      </li>\n      <li> BAD_DATA_FORMAT \"ResourceAttributes.*\" - bad resource string\n      </li>\n      <li> LIMIT_REACHED \"ResourceAttribute.*\" - attribute string too long\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - resource\n    \"\"\"\n    pass\n\n  def getResourceData(self, authenticationToken, guid):\n    \"\"\"\n    Returns binary data of the resource with the provided GUID.  For\n    example, if this were an image resource, this would contain the\n    raw bits of the image.\n    If the Resource is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).\n    \n    @param guid\n      The GUID of the resource to be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def getResourceByHash(self, authenticationToken, noteGuid, contentHash, withData, withRecognition, withAlternateData):\n    \"\"\"\n    Returns the current state of a resource, referenced by containing\n    note GUID and resource content hash.\n    \n    @param noteGuid\n      The GUID of the note that holds the resource to be retrieved.\n    \n    @param contentHash\n      The MD5 checksum of the resource within that note. Note that\n      this is the binary checksum, for example from Resource.data.bodyHash,\n      and not the hex-encoded checksum that is used within an en-media\n      tag in a note body.\n    \n    @param withData\n      If true, the Resource will include the binary contents of the\n      'data' field's body.\n    \n    @param withRecognition\n      If true, the Resource will include the binary contents of the\n      'recognition' field's body.\n    \n    @param withAlternateData\n      If true, the Resource will include the binary contents of the\n      'alternateData' field's body, if an alternate form is present.\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"Note.guid\" - noteGuid param missing\n      </li>\n      <li> DATA_REQUIRED \"Note.contentHash\" - contentHash param missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note\" - not found, by guid\n      </li>\n      <li> \"Resource\" - not found, by hash\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - noteGuid\n     - contentHash\n     - withData\n     - withRecognition\n     - withAlternateData\n    \"\"\"\n    pass\n\n  def getResourceRecognition(self, authenticationToken, guid):\n    \"\"\"\n    Returns the binary contents of the recognition index for the resource\n    with the provided GUID.  If the caller asks about a resource that has\n    no recognition data, this will throw EDAMNotFoundException.\n    If the Resource is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).\n    \n    @param guid\n      The GUID of the resource whose recognition data should be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n      <li> \"Resource.recognition\" - resource has no recognition\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def getResourceAlternateData(self, authenticationToken, guid):\n    \"\"\"\n    If the Resource with the provided GUID has an alternate data representation\n    (indicated via the Resource.alternateData field), then this request can\n    be used to retrieve the binary contents of that alternate data file.\n    If the caller asks about a resource that has no alternate data form, this\n    will throw EDAMNotFoundException.\n    \n    @param guid\n       The GUID of the resource whose recognition data should be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n      <li> \"Resource.alternateData\" - resource has no recognition\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def getResourceAttributes(self, authenticationToken, guid):\n    \"\"\"\n    Returns the set of attributes for the Resource with the provided GUID.\n    If the Resource is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).\n    \n    @param guid\n      The GUID of the resource whose attributes should be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def getPublicNotebook(self, userId, publicUri):\n    \"\"\"\n    <p>\n    Looks for a user account with the provided userId on this NoteStore\n    shard and determines whether that account contains a public notebook\n    with the given URI.  If the account is not found, or no public notebook\n    exists with this URI, this will throw an EDAMNotFoundException,\n    otherwise this will return the information for that Notebook.\n    </p>\n    <p>\n    If a notebook is visible on the web with a full URL like\n    http://www.evernote.com/pub/sethdemo/api\n    Then 'sethdemo' is the username that can be used to look up the userId,\n    and 'api' is the publicUri.\n    </p>\n    \n    @param userId\n       The numeric identifier for the user who owns the public notebook.\n       To find this value based on a username string, you can invoke\n       UserStore.getPublicUserInfo\n    \n    @param publicUri\n       The uri string for the public notebook, from Notebook.publishing.uri.\n    \n    @throws EDAMNotFoundException <ul>\n      <li>\"Publishing.uri\" - not found, by URI</li>\n    </ul>\n    \n    @throws EDAMSystemException <ul>\n      <li> TAKEN_DOWN \"PublicNotebook\" - The specified public notebook is\n        taken down (for all requesters).</li>\n      <li> TAKEN_DOWN \"Country\" - The specified public notebook is taken\n        down for the requester because of an IP-based country lookup.</li>\n    </ul>\n    \n    Parameters:\n     - userId\n     - publicUri\n    \"\"\"\n    pass\n\n  def createSharedNotebook(self, authenticationToken, sharedNotebook):\n    \"\"\"\n    Used to construct a shared notebook object. The constructed notebook will\n    contain a \"share key\" which serve as a unique identifer and access token\n    for a user to access the notebook of the shared notebook owner.\n    \n    @param sharedNotebook\n      A shared notebook object populated with the email address of the share\n      recipient, the notebook guid and the access permissions. All other\n      attributes of the shared object are ignored. The SharedNotebook.allowPreview\n      field must be explicitly set with either a true or false value.\n    \n    @return\n      The fully populated SharedNotebook object including the server assigned\n      share id and shareKey which can both be used to uniquely identify the\n      SharedNotebook.\n    \n    @throws EDAMUserException <ul>\n      <li>BAD_DATA_FORMAT \"SharedNotebook.email\" - if the email was not valid</li>\n      <li>BAD_DATA_FORMAT \"requireLogin\" - if the SharedNotebook.allowPreview field was\n          not set, and the SharedNotebook.requireLogin was also not set or was set to\n          false.</li>\n      <li>PERMISSION_DENIED \"SharedNotebook.recipientSettings\" - if\n          recipientSettings is set in the sharedNotebook.  Only the recipient\n          can set these values via the setSharedNotebookRecipientSettings\n          method.\n      </li>\n      </ul>\n    @throws EDAMNotFoundException <ul>\n      <li>Notebook.guid - if the notebookGuid is not a valid GUID for the user.\n      </li>\n      </ul>\n    \n    Parameters:\n     - authenticationToken\n     - sharedNotebook\n    \"\"\"\n    pass\n\n  def updateSharedNotebook(self, authenticationToken, sharedNotebook):\n    \"\"\"\n    Update a SharedNotebook object.\n    \n    @param authenticationToken\n      Must be an authentication token from the owner or a shared notebook\n      authentication token or business authentication token with sufficient\n      permissions to change invitations for a notebook.\n    \n    @param sharedNotebook\n     The SharedNotebook object containing the requested changes.\n     The \"id\" of the shared notebook must be set to allow the service\n     to identify the SharedNotebook to be updated. In addition, you MUST set\n     the email, permission, and allowPreview fields to the desired values.\n     All other fields will be ignored if set.\n    \n    @return\n     The Update Serial Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li>UNSUPPORTED_OPERATION \"updateSharedNotebook\" - if this service instance does not support shared notebooks.</li>\n      <li>BAD_DATA_FORMAT \"SharedNotebook.email\" - if the email was not valid.</li>\n      <li>DATA_REQUIRED \"SharedNotebook.id\" - if the id field was not set.</li>\n      <li>DATA_REQUIRED \"SharedNotebook.privilege\" - if the privilege field was not set.</li>\n      <li>DATA_REQUIRED \"SharedNotebook.allowPreview\" - if the allowPreview field was not set.</li>\n      </ul>\n    @throws EDAMNotFoundException <ul>\n      <li>SharedNotebook.id - if no shared notebook with the specified ID was found.\n      </ul>\n    \n    Parameters:\n     - authenticationToken\n     - sharedNotebook\n    \"\"\"\n    pass\n\n  def setSharedNotebookRecipientSettings(self, authenticationToken, sharedNotebookId, recipientSettings):\n    \"\"\"\n    Set values for the recipient settings associated with a shared notebook.  Having\n    update rights to the shared notebook record itself has no effect on this call;\n    only the recipient of the shared notebook can can the recipient settings.\n    \n    If you do <i>not</i> wish to, or cannot, change one of the reminderNotifyEmail or\n    reminderNotifyInApp fields, you must leave that field unset in recipientSettings.\n    This method will skip that field for updates and leave the existing state as\n    it is.\n    \n    @return The update sequence number of the account to which the shared notebook\n      belongs, which is the account from which we are sharing a notebook.\n    \n    @throws EDAMNotFoundException \"sharedNotebookId\" - Thrown if the service does not\n      have a shared notebook record for the sharedNotebookId on the given shard.  If you\n      receive this exception, it is probable that the shared notebook record has\n      been revoked or expired, or that you accessed the wrong shard.\n    \n    @throws EDAMUserException <ul>\n      <li>PEMISSION_DENIED \"authenticationToken\" - If you do not have permission to set\n          the recipient settings for the shared notebook.  Only the recipient has\n          permission to do this.\n      <li>DATA_CONFLICT \"recipientSettings.reminderNotifyEmail\" - Setting whether\n          or not you want to receive reminder e-mail notifications is possible on\n          a business notebook in the business to which the user belongs.  All\n          others can safely unset the reminderNotifyEmail field from the\n          recipientSettings parameter.\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - sharedNotebookId\n     - recipientSettings\n    \"\"\"\n    pass\n\n  def sendMessageToSharedNotebookMembers(self, authenticationToken, notebookGuid, messageText, recipients):\n    \"\"\"\n    Send a reminder message to some or all of the email addresses that a notebook has been\n    shared with. The message includes the current link to view the notebook.\n    @param authenticationToken\n      The auth token of the user with permissions to share the notebook\n    @param notebookGuid\n      The guid of the shared notebook\n    @param messageText\n     User provided text to include in the email\n    @param recipients\n     The email addresses of the recipients. If this list is empty then all of the\n     users that the notebook has been shared with are emailed.\n     If an email address doesn't correspond to share invite members then that address\n     is ignored.\n    @return\n     The number of messages sent\n    @throws EDAMUserException <ul>\n      <li> LIMIT_REACHED \"(recipients)\" -\n        The email can't be sent because this would exceed the user's daily\n        email limit.\n      </li>\n      <li> PERMISSION_DENIED \"Notebook.guid\" - The user doesn't have permission to\n        send a message for the specified notebook.\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - notebookGuid\n     - messageText\n     - recipients\n    \"\"\"\n    pass\n\n  def listSharedNotebooks(self, authenticationToken):\n    \"\"\"\n    Lists the collection of shared notebooks for all notebooks in the\n    users account.\n    \n    @return\n     The list of all SharedNotebooks for the user\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def expungeSharedNotebooks(self, authenticationToken, sharedNotebookIds):\n    \"\"\"\n    Expunges the SharedNotebooks in the user's account using the\n    SharedNotebook.id as the identifier.\n    <p/>\n    NOTE: This function is generally not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param\n      sharedNotebookIds - a list of ShardNotebook.id longs identifying the\n          objects to delete permanently.\n    \n    @return\n      The account's update sequence number.\n    \n    Parameters:\n     - authenticationToken\n     - sharedNotebookIds\n    \"\"\"\n    pass\n\n  def createLinkedNotebook(self, authenticationToken, linkedNotebook):\n    \"\"\"\n    Asks the service to make a linked notebook with the provided name, username\n    of the owner and identifiers provided. A linked notebook can be either a\n    link to a public notebook or to a private shared notebook.\n    \n    @param linkedNotebook\n      The desired fields for the linked notebook must be provided on this\n      object.  The name of the linked notebook must be set. Either a username\n      uri or a shard id and share key must be provided otherwise a\n      EDAMUserException is thrown.\n    \n    @return\n      The newly created LinkedNotebook.  The server-side id will be\n      saved in this object's 'id' field.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"LinkedNotebook.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"LinkedNotebook.username\" - bad username format\n      </li>\n      <li> BAD_DATA_FORMAT \"LinkedNotebook.uri\" -\n        if public notebook set but bad uri\n      </li>\n      <li> BAD_DATA_FORMAT \"LinkedNotebook.shareKey\" -\n        if private notebook set but bad shareKey\n      </li>\n      <li> DATA_REQUIRED \"LinkedNotebook.shardId\" -\n        if private notebook but shard id not provided\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - linkedNotebook\n    \"\"\"\n    pass\n\n  def updateLinkedNotebook(self, authenticationToken, linkedNotebook):\n    \"\"\"\n    @param linkedNotebook\n      Updates the name of a linked notebook.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"LinkedNotebook.name\" - invalid length or pattern\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - linkedNotebook\n    \"\"\"\n    pass\n\n  def listLinkedNotebooks(self, authenticationToken):\n    \"\"\"\n    Returns a list of linked notebooks\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def expungeLinkedNotebook(self, authenticationToken, guid):\n    \"\"\"\n    Permanently expunges the linked notebook from the account.\n    <p/>\n    NOTE: This function is generally not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param guid\n      The LinkedNotebook.guid field of the LinkedNotebook to permanently remove\n      from the account.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def authenticateToSharedNotebook(self, shareKey, authenticationToken):\n    \"\"\"\n    Asks the service to produce an authentication token that can be used to\n    access the contents of a shared notebook from someone else's account.\n    This authenticationToken can be used with the various other NoteStore\n    calls to find and retrieve notes, and if the permissions in the shared\n    notebook are sufficient, to make changes to the contents of the notebook.\n    \n    @param shareKey\n      The 'shareKey' identifier from the SharedNotebook that was granted to\n      some recipient.  This string internally encodes the notebook identifier\n      and a security signature.\n    \n    @param authenticationToken\n      If a non-empty string is provided, this is the full user-based\n      authentication token that identifies the user who is currently logged in\n      and trying to access the shared notebook.  This may be required if the\n      notebook was created with 'requireLogin'.\n      If this string is empty, the service will attempt to authenticate to the\n      shared notebook without any logged in user.\n    \n    @throws EDAMSystemException <ul>\n      <li> BAD_DATA_FORMAT \"shareKey\" - invalid shareKey string\n      </li>\n      <li> INVALID_AUTH \"shareKey\" - bad signature on shareKey string\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"SharedNotebook.id\" - the shared notebook no longer exists\n      </li>\n    </ul>\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"authenticationToken\" - the share requires login, and\n             no valid authentication token was provided.\n      </li>\n      <li> PERMISSION_DENIED \"SharedNotebook.username\" - share requires login,\n             and another username has already been bound to this notebook.\n      </li>\n    </ul>\n    \n    Parameters:\n     - shareKey\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def getSharedNotebookByAuth(self, authenticationToken):\n    \"\"\"\n    This function is used to retrieve extended information about a shared\n    notebook by a guest who has already authenticated to access that notebook.\n    This requires an 'authenticationToken' parameter which should be the\n    resut of a call to authenticateToSharedNotebook(...).\n    I.e. this is the token that gives access to the particular shared notebook\n    in someone else's account -- it's not the authenticationToken for the\n    owner of the notebook itself.\n    \n    @param authenticationToken\n      Should be the authentication token retrieved from the reply of\n      authenticateToSharedNotebook(), proving access to a particular shared\n      notebook.\n    \n    @throws EDAMUserException <ul>\n      <li> PERMISSION_DENIED \"authenticationToken\" -\n             authentication token doesn't correspond to a valid shared notebook\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"SharedNotebook.id\" - the shared notebook no longer exists\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def emailNote(self, authenticationToken, parameters):\n    \"\"\"\n    Attempts to send a single note to one or more email recipients.\n    <p/>\n    NOTE: This function is generally not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param authenticationToken\n       The note will be sent as the user logged in via this token, using that\n       user's registered email address.  If the authenticated user doesn't\n       have permission to read that note, the emailing will fail.\n    \n    @param parameters\n       The note must be specified either by GUID (in which case it will be\n       sent using the existing data in the service), or else the full Note\n       must be passed to this call.  This also specifies the additional\n       email fields that will be used in the email.\n    \n    @throws EDAMUserException <ul>\n      <li> LIMIT_REACHED \"NoteEmailParameters.toAddresses\" -\n        The email can't be sent because this would exceed the user's daily\n        email limit.\n      </li>\n      <li> BAD_DATA_FORMAT \"(email address)\" -\n        email address malformed\n      </li>\n      <li> DATA_REQUIRED \"NoteEmailParameters.toAddresses\" -\n        if there are no To: or Cc: addresses provided.\n      </li>\n      <li> DATA_REQUIRED \"Note.title\" -\n        if the caller provides a Note parameter with no title\n      </li>\n      <li> DATA_REQUIRED \"Note.content\" -\n        if the caller provides a Note parameter with no content\n      </li>\n      <li> ENML_VALIDATION \"*\" - note content doesn't validate against DTD\n      </li>\n      <li> DATA_REQUIRED \"NoteEmailParameters.note\" -\n        if no guid or note provided\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - parameters\n    \"\"\"\n    pass\n\n  def shareNote(self, authenticationToken, guid):\n    \"\"\"\n    If this note is not already shared (via its own direct URL), then this\n    will start sharing that note.\n    This will return the secret \"Note Key\" for this note that\n    can currently be used in conjunction with the Note's GUID to gain direct\n    read-only access to the Note.\n    If the note is already shared, then this won't make any changes to the\n    note, and the existing \"Note Key\" will be returned.  The only way to change\n    the Note Key for an existing note is to stopSharingNote first, and then\n    call this function.\n    \n    @param guid\n      The GUID of the note to be shared.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def stopSharingNote(self, authenticationToken, guid):\n    \"\"\"\n    If this note is not already shared then this will stop sharing that note\n    and invalidate its \"Note Key\", so any existing URLs to access that Note\n    will stop working.\n    If the Note is not shared, then this function will do nothing.\n    \n    @param guid\n      The GUID of the note to be un-shared.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    pass\n\n  def authenticateToSharedNote(self, guid, noteKey, authenticationToken):\n    \"\"\"\n    Asks the service to produce an authentication token that can be used to\n    access the contents of a single Note which was individually shared\n    from someone's account.\n    This authenticationToken can be used with the various other NoteStore\n    calls to find and retrieve the Note and its directly-referenced children.\n    \n    @param guid\n      The GUID identifying this Note on this shard.\n    \n    @param noteKey\n      The 'noteKey' identifier from the Note that was originally created via\n      a call to shareNote() and then given to a recipient to access.\n    \n    @param authenticationToken\n      An optional authenticationToken that identifies the user accessing the\n      shared note. This parameter may be required to access some shared notes.\n    \n    @throws EDAMUserException <ul>\n      <li> PERMISSION_DENIED \"Note\" - the Note with that GUID is either not\n        shared, or the noteKey doesn't match the current key for this note\n      </li>\n      <li> PERMISSION_DENIED \"authenticationToken\" - an authentication token is\n        required to access this Note, but either no authentication token or a\n        \"non-owner\" authentication token was provided.\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"guid\" - the note with that GUID is not found\n      </li>\n    </ul>\n    \n    @throws EDAMSystemException <ul>\n      <li> TAKEN_DOWN \"Note\" - The specified shared note is taken down (for\n        all requesters).\n      </li>\n      <li> TAKEN_DOWN \"Country\" - The specified shared note is taken down\n        for the requester because of an IP-based country lookup.\n      </ul>\n    </ul>\n    \n    Parameters:\n     - guid\n     - noteKey\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def findRelated(self, authenticationToken, query, resultSpec):\n    \"\"\"\n    Identify related entities on the service, such as notes,\n    notebooks, and tags related to notes or content.\n    \n    @param query\n      The information about which we are finding related entities.\n    \n    @param resultSpec\n      Allows the client to indicate the type and quantity of\n      information to be returned, allowing a saving of time and\n      bandwidth.\n    \n    @return\n      The result of the query, with information considered\n      to likely be relevantly related to the information\n      described by the query.\n    \n    @throws EDAMUserException <ul>\n      <li>BAD_DATA_FORMAT \"RelatedQuery.plainText\" - If you provided a\n        a zero-length plain text value.\n      </li>\n      <li>BAD_DATA_FORMAT \"RelatedQuery.noteGuid\" - If you provided an\n        invalid Note GUID, that is, one that does not match the constraints\n        defined by EDAM_GUID_LEN_MIN, EDAM_GUID_LEN_MAX, EDAM_GUID_REGEX.\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.notebookGuid\" - if malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.tagGuids\" - if any are malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.words\" - if search string too long\n      </li>\n      <li>PERMISSION_DENIED \"Note\" - If the caller does not have access to\n        the note identified by RelatedQuery.noteGuid.\n      </li>\n      <li>DATA_REQUIRED \"RelatedResultSpec\" - If you did not not set any values\n        in the result spec.\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li>\"RelatedQuery.noteGuid\" - the note with that GUID is not\n        found, if that field has been set in the query.\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - query\n     - resultSpec\n    \"\"\"\n    pass\n\n\nclass Client(Iface):\n  def __init__(self, iprot, oprot=None):\n    self._iprot = self._oprot = iprot\n    if oprot is not None:\n      self._oprot = oprot\n    self._seqid = 0\n\n  def getSyncState(self, authenticationToken):\n    \"\"\"\n    Asks the NoteStore to provide information about the status of the user\n    account corresponding to the provided authentication token.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_getSyncState(authenticationToken)\n    return self.recv_getSyncState()\n\n  def send_getSyncState(self, authenticationToken):\n    self._oprot.writeMessageBegin('getSyncState', TMessageType.CALL, self._seqid)\n    args = getSyncState_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getSyncState(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getSyncState_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getSyncState failed: unknown result\");\n\n  def getSyncStateWithMetrics(self, authenticationToken, clientMetrics):\n    \"\"\"\n    Asks the NoteStore to provide information about the status of the user\n    account corresponding to the provided authentication token.\n    This version of 'getSyncState' allows the client to upload coarse-\n    grained usage metrics to the service.\n    \n    @param clientMetrics  see the documentation of the ClientUsageMetrics\n      structure for an explanation of the fields that clients can pass to\n      the service.\n    \n    Parameters:\n     - authenticationToken\n     - clientMetrics\n    \"\"\"\n    self.send_getSyncStateWithMetrics(authenticationToken, clientMetrics)\n    return self.recv_getSyncStateWithMetrics()\n\n  def send_getSyncStateWithMetrics(self, authenticationToken, clientMetrics):\n    self._oprot.writeMessageBegin('getSyncStateWithMetrics', TMessageType.CALL, self._seqid)\n    args = getSyncStateWithMetrics_args()\n    args.authenticationToken = authenticationToken\n    args.clientMetrics = clientMetrics\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getSyncStateWithMetrics(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getSyncStateWithMetrics_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getSyncStateWithMetrics failed: unknown result\");\n\n  def getSyncChunk(self, authenticationToken, afterUSN, maxEntries, fullSyncOnly):\n    \"\"\"\n    DEPRECATED - use getFilteredSyncChunk.\n    \n    Parameters:\n     - authenticationToken\n     - afterUSN\n     - maxEntries\n     - fullSyncOnly\n    \"\"\"\n    self.send_getSyncChunk(authenticationToken, afterUSN, maxEntries, fullSyncOnly)\n    return self.recv_getSyncChunk()\n\n  def send_getSyncChunk(self, authenticationToken, afterUSN, maxEntries, fullSyncOnly):\n    self._oprot.writeMessageBegin('getSyncChunk', TMessageType.CALL, self._seqid)\n    args = getSyncChunk_args()\n    args.authenticationToken = authenticationToken\n    args.afterUSN = afterUSN\n    args.maxEntries = maxEntries\n    args.fullSyncOnly = fullSyncOnly\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getSyncChunk(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getSyncChunk_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getSyncChunk failed: unknown result\");\n\n  def getFilteredSyncChunk(self, authenticationToken, afterUSN, maxEntries, filter):\n    \"\"\"\n    Asks the NoteStore to provide the state of the account in order of\n    last modification.  This request retrieves one block of the server's\n    state so that a client can make several small requests against a large\n    account rather than getting the entire state in one big message.\n    This call gives fine-grained control of the data that will\n    be received by a client by omitting data elements that a client doesn't\n    need. This may reduce network traffic and sync times.\n    \n    @param afterUSN\n      The client can pass this value to ask only for objects that\n      have been updated after a certain point.  This allows the client to\n      receive updates after its last checkpoint rather than doing a full\n      synchronization on every pass.  The default value of \"0\" indicates\n      that the client wants to get objects from the start of the account.\n    \n    @param maxEntries\n      The maximum number of modified objects that should be\n      returned in the result SyncChunk.  This can be used to limit the size\n      of each individual message to be friendly for network transfer.\n    \n    @param filter\n      The caller must set some of the flags in this structure to specify which\n      data types should be returned during the synchronization.  See\n      the SyncChunkFilter structure for information on each flag.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"afterUSN\" - if negative\n      </li>\n      <li> BAD_DATA_FORMAT \"maxEntries\" - if less than 1\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - afterUSN\n     - maxEntries\n     - filter\n    \"\"\"\n    self.send_getFilteredSyncChunk(authenticationToken, afterUSN, maxEntries, filter)\n    return self.recv_getFilteredSyncChunk()\n\n  def send_getFilteredSyncChunk(self, authenticationToken, afterUSN, maxEntries, filter):\n    self._oprot.writeMessageBegin('getFilteredSyncChunk', TMessageType.CALL, self._seqid)\n    args = getFilteredSyncChunk_args()\n    args.authenticationToken = authenticationToken\n    args.afterUSN = afterUSN\n    args.maxEntries = maxEntries\n    args.filter = filter\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getFilteredSyncChunk(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getFilteredSyncChunk_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getFilteredSyncChunk failed: unknown result\");\n\n  def getLinkedNotebookSyncState(self, authenticationToken, linkedNotebook):\n    \"\"\"\n    Asks the NoteStore to provide information about the status of a linked\n    notebook that has been shared with the caller, or that is public to the\n    world.\n    This will return a result that is similar to getSyncState, but may omit\n    SyncState.uploaded if the caller doesn't have permission to write to\n    the linked notebook.\n    \n    This function must be called on the shard that owns the referenced\n    notebook.  (I.e. the shardId in /shard/shardId/edam/note must be the\n    same as LinkedNotebook.shardId.)\n    \n    @param authenticationToken\n      This should be an authenticationToken for the guest who has received\n      the invitation to the share.  (I.e. this should not be the result of\n      NoteStore.authenticateToSharedNotebook)\n    \n    @param linkedNotebook\n      This structure should contain identifying information and permissions\n      to access the notebook in question.\n    \n    Parameters:\n     - authenticationToken\n     - linkedNotebook\n    \"\"\"\n    self.send_getLinkedNotebookSyncState(authenticationToken, linkedNotebook)\n    return self.recv_getLinkedNotebookSyncState()\n\n  def send_getLinkedNotebookSyncState(self, authenticationToken, linkedNotebook):\n    self._oprot.writeMessageBegin('getLinkedNotebookSyncState', TMessageType.CALL, self._seqid)\n    args = getLinkedNotebookSyncState_args()\n    args.authenticationToken = authenticationToken\n    args.linkedNotebook = linkedNotebook\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getLinkedNotebookSyncState(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getLinkedNotebookSyncState_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getLinkedNotebookSyncState failed: unknown result\");\n\n  def getLinkedNotebookSyncChunk(self, authenticationToken, linkedNotebook, afterUSN, maxEntries, fullSyncOnly):\n    \"\"\"\n    Asks the NoteStore to provide information about the contents of a linked\n    notebook that has been shared with the caller, or that is public to the\n    world.\n    This will return a result that is similar to getSyncChunk, but will only\n    contain entries that are visible to the caller.  I.e. only that particular\n    Notebook will be visible, along with its Notes, and Tags on those Notes.\n    \n    This function must be called on the shard that owns the referenced\n    notebook.  (I.e. the shardId in /shard/shardId/edam/note must be the\n    same as LinkedNotebook.shardId.)\n    \n    @param authenticationToken\n      This should be an authenticationToken for the guest who has received\n      the invitation to the share.  (I.e. this should not be the result of\n      NoteStore.authenticateToSharedNotebook)\n    \n    @param linkedNotebook\n      This structure should contain identifying information and permissions\n      to access the notebook in question.  This must contain the valid fields\n      for either a shared notebook (e.g. shareKey)\n      or a public notebook (e.g. username, uri)\n    \n    @param afterUSN\n      The client can pass this value to ask only for objects that\n      have been updated after a certain point.  This allows the client to\n      receive updates after its last checkpoint rather than doing a full\n      synchronization on every pass.  The default value of \"0\" indicates\n      that the client wants to get objects from the start of the account.\n    \n    @param maxEntries\n      The maximum number of modified objects that should be\n      returned in the result SyncChunk.  This can be used to limit the size\n      of each individual message to be friendly for network transfer.\n      Applications should not request more than 256 objects at a time,\n      and must handle the case where the service returns less than the\n      requested number of objects in a given request even though more\n      objects are available on the service.\n    \n    @param fullSyncOnly\n      If true, then the client only wants initial data for a full sync.\n      In this case, the service will not return any expunged objects,\n      and will not return any Resources, since these are also provided\n      in their corresponding Notes.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"afterUSN\" - if negative\n      </li>\n      <li> BAD_DATA_FORMAT \"maxEntries\" - if less than 1\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"LinkedNotebook\" - if the provided information doesn't match any\n        valid notebook\n      </li>\n      <li> \"LinkedNotebook.uri\" - if the provided public URI doesn't match any\n        valid notebook\n      </li>\n      <li> \"SharedNotebook.id\" - if the provided information indicates a\n         shared notebook that no longer exists\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - linkedNotebook\n     - afterUSN\n     - maxEntries\n     - fullSyncOnly\n    \"\"\"\n    self.send_getLinkedNotebookSyncChunk(authenticationToken, linkedNotebook, afterUSN, maxEntries, fullSyncOnly)\n    return self.recv_getLinkedNotebookSyncChunk()\n\n  def send_getLinkedNotebookSyncChunk(self, authenticationToken, linkedNotebook, afterUSN, maxEntries, fullSyncOnly):\n    self._oprot.writeMessageBegin('getLinkedNotebookSyncChunk', TMessageType.CALL, self._seqid)\n    args = getLinkedNotebookSyncChunk_args()\n    args.authenticationToken = authenticationToken\n    args.linkedNotebook = linkedNotebook\n    args.afterUSN = afterUSN\n    args.maxEntries = maxEntries\n    args.fullSyncOnly = fullSyncOnly\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getLinkedNotebookSyncChunk(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getLinkedNotebookSyncChunk_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getLinkedNotebookSyncChunk failed: unknown result\");\n\n  def listNotebooks(self, authenticationToken):\n    \"\"\"\n    Returns a list of all of the notebooks in the account.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_listNotebooks(authenticationToken)\n    return self.recv_listNotebooks()\n\n  def send_listNotebooks(self, authenticationToken):\n    self._oprot.writeMessageBegin('listNotebooks', TMessageType.CALL, self._seqid)\n    args = listNotebooks_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_listNotebooks(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = listNotebooks_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"listNotebooks failed: unknown result\");\n\n  def getNotebook(self, authenticationToken, guid):\n    \"\"\"\n    Returns the current state of the notebook with the provided GUID.\n    The notebook may be active or deleted (but not expunged).\n    \n    @param guid\n      The GUID of the notebook to be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Notebook.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Notebook\" - private notebook, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - tag not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_getNotebook(authenticationToken, guid)\n    return self.recv_getNotebook()\n\n  def send_getNotebook(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('getNotebook', TMessageType.CALL, self._seqid)\n    args = getNotebook_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getNotebook failed: unknown result\");\n\n  def getDefaultNotebook(self, authenticationToken):\n    \"\"\"\n    Returns the notebook that should be used to store new notes in the\n    user's account when no other notebooks are specified.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_getDefaultNotebook(authenticationToken)\n    return self.recv_getDefaultNotebook()\n\n  def send_getDefaultNotebook(self, authenticationToken):\n    self._oprot.writeMessageBegin('getDefaultNotebook', TMessageType.CALL, self._seqid)\n    args = getDefaultNotebook_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getDefaultNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getDefaultNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getDefaultNotebook failed: unknown result\");\n\n  def createNotebook(self, authenticationToken, notebook):\n    \"\"\"\n    Asks the service to make a notebook with the provided name.\n    \n    @param notebook\n      The desired fields for the notebook must be provided on this\n      object.  The name of the notebook must be set, and either the 'active'\n      or 'defaultNotebook' fields may be set by the client at creation.\n      If a notebook exists in the account with the same name (via\n      case-insensitive compare), this will throw an EDAMUserException.\n    \n    @return\n      The newly created Notebook.  The server-side GUID will be\n      saved in this object's 'guid' field.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Notebook.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Notebook.stack\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Publishing.uri\" - if publishing set but bad uri\n      </li>\n      <li> BAD_DATA_FORMAT \"Publishing.publicDescription\" - if too long\n      </li>\n      <li> DATA_CONFLICT \"Notebook.name\" - name already in use\n      </li>\n      <li> DATA_CONFLICT \"Publishing.uri\" - if URI already in use\n      </li>\n      <li> DATA_REQUIRED \"Publishing.uri\" - if publishing set but uri missing\n      </li>\n      <li> LIMIT_REACHED \"Notebook\" - at max number of notebooks\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - notebook\n    \"\"\"\n    self.send_createNotebook(authenticationToken, notebook)\n    return self.recv_createNotebook()\n\n  def send_createNotebook(self, authenticationToken, notebook):\n    self._oprot.writeMessageBegin('createNotebook', TMessageType.CALL, self._seqid)\n    args = createNotebook_args()\n    args.authenticationToken = authenticationToken\n    args.notebook = notebook\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_createNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = createNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"createNotebook failed: unknown result\");\n\n  def updateNotebook(self, authenticationToken, notebook):\n    \"\"\"\n    Submits notebook changes to the service.  The provided data must include\n    the notebook's guid field for identification.\n    \n    @param notebook\n      The notebook object containing the requested changes.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Notebook.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Notebook.stack\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Publishing.uri\" - if publishing set but bad uri\n      </li>\n      <li> BAD_DATA_FORMAT \"Publishing.publicDescription\" - if too long\n      </li>\n      <li> DATA_CONFLICT \"Notebook.name\" - name already in use\n      </li>\n      <li> DATA_CONFLICT \"Publishing.uri\" - if URI already in use\n      </li>\n      <li> DATA_REQUIRED \"Publishing.uri\" - if publishing set but uri missing\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - notebook\n    \"\"\"\n    self.send_updateNotebook(authenticationToken, notebook)\n    return self.recv_updateNotebook()\n\n  def send_updateNotebook(self, authenticationToken, notebook):\n    self._oprot.writeMessageBegin('updateNotebook', TMessageType.CALL, self._seqid)\n    args = updateNotebook_args()\n    args.authenticationToken = authenticationToken\n    args.notebook = notebook\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_updateNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = updateNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"updateNotebook failed: unknown result\");\n\n  def expungeNotebook(self, authenticationToken, guid):\n    \"\"\"\n    Permanently removes the notebook from the user's account.\n    After this action, the notebook is no longer available for undeletion, etc.\n    If the notebook contains any Notes, they will be moved to the current\n    default notebook and moved into the trash (i.e. Note.active=false).\n    <p/>\n    NOTE: This function is generally not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param guid\n      The GUID of the notebook to delete.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Notebook.guid\" - if the parameter is missing\n      </li>\n      <li> LIMIT_REACHED \"Notebook\" - trying to expunge the last Notebook\n      </li>\n      <li> PERMISSION_DENIED \"Notebook\" - private notebook, user doesn't own\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_expungeNotebook(authenticationToken, guid)\n    return self.recv_expungeNotebook()\n\n  def send_expungeNotebook(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('expungeNotebook', TMessageType.CALL, self._seqid)\n    args = expungeNotebook_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_expungeNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = expungeNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"expungeNotebook failed: unknown result\");\n\n  def listTags(self, authenticationToken):\n    \"\"\"\n    Returns a list of the tags in the account.  Evernote does not support\n    the undeletion of tags, so this will only include active tags.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_listTags(authenticationToken)\n    return self.recv_listTags()\n\n  def send_listTags(self, authenticationToken):\n    self._oprot.writeMessageBegin('listTags', TMessageType.CALL, self._seqid)\n    args = listTags_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_listTags(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = listTags_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"listTags failed: unknown result\");\n\n  def listTagsByNotebook(self, authenticationToken, notebookGuid):\n    \"\"\"\n    Returns a list of the tags that are applied to at least one note within\n    the provided notebook.  If the notebook is public, the authenticationToken\n    may be ignored.\n    \n    @param notebookGuid\n       the GUID of the notebook to use to find tags\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - notebook not found by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - notebookGuid\n    \"\"\"\n    self.send_listTagsByNotebook(authenticationToken, notebookGuid)\n    return self.recv_listTagsByNotebook()\n\n  def send_listTagsByNotebook(self, authenticationToken, notebookGuid):\n    self._oprot.writeMessageBegin('listTagsByNotebook', TMessageType.CALL, self._seqid)\n    args = listTagsByNotebook_args()\n    args.authenticationToken = authenticationToken\n    args.notebookGuid = notebookGuid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_listTagsByNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = listTagsByNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"listTagsByNotebook failed: unknown result\");\n\n  def getTag(self, authenticationToken, guid):\n    \"\"\"\n    Returns the current state of the Tag with the provided GUID.\n    \n    @param guid\n      The GUID of the tag to be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Tag.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Tag\" - private Tag, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Tag.guid\" - tag not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_getTag(authenticationToken, guid)\n    return self.recv_getTag()\n\n  def send_getTag(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('getTag', TMessageType.CALL, self._seqid)\n    args = getTag_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getTag(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getTag_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getTag failed: unknown result\");\n\n  def createTag(self, authenticationToken, tag):\n    \"\"\"\n    Asks the service to make a tag with a set of information.\n    \n    @param tag\n      The desired list of fields for the tag are specified in this\n      object.  The caller must specify the tag name, and may provide\n      the parentGUID.\n    \n    @return\n      The newly created Tag.  The server-side GUID will be\n      saved in this object.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Tag.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Tag.parentGuid\" - malformed GUID\n      </li>\n      <li> DATA_CONFLICT \"Tag.name\" - name already in use\n      </li>\n      <li> LIMIT_REACHED \"Tag\" - at max number of tags\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Tag.parentGuid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - tag\n    \"\"\"\n    self.send_createTag(authenticationToken, tag)\n    return self.recv_createTag()\n\n  def send_createTag(self, authenticationToken, tag):\n    self._oprot.writeMessageBegin('createTag', TMessageType.CALL, self._seqid)\n    args = createTag_args()\n    args.authenticationToken = authenticationToken\n    args.tag = tag\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_createTag(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = createTag_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"createTag failed: unknown result\");\n\n  def updateTag(self, authenticationToken, tag):\n    \"\"\"\n    Submits tag changes to the service.  The provided data must include\n    the tag's guid field for identification.  The service will apply\n    updates to the following tag fields:  name, parentGuid\n    \n    @param tag\n      The tag object containing the requested changes.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Tag.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Tag.parentGuid\" - malformed GUID\n      </li>\n      <li> DATA_CONFLICT \"Tag.name\" - name already in use\n      </li>\n      <li> DATA_CONFLICT \"Tag.parentGuid\" - can't set parent: circular\n      </li>\n      <li> PERMISSION_DENIED \"Tag\" - user doesn't own tag\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Tag.guid\" - tag not found, by GUID\n      </li>\n      <li> \"Tag.parentGuid\" - parent not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - tag\n    \"\"\"\n    self.send_updateTag(authenticationToken, tag)\n    return self.recv_updateTag()\n\n  def send_updateTag(self, authenticationToken, tag):\n    self._oprot.writeMessageBegin('updateTag', TMessageType.CALL, self._seqid)\n    args = updateTag_args()\n    args.authenticationToken = authenticationToken\n    args.tag = tag\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_updateTag(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = updateTag_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"updateTag failed: unknown result\");\n\n  def untagAll(self, authenticationToken, guid):\n    \"\"\"\n    Removes the provided tag from every note that is currently tagged with\n    this tag.  If this operation is successful, the tag will still be in\n    the account, but it will not be tagged on any notes.\n    \n    This function is not indended for use by full synchronizing clients, since\n    it does not provide enough result information to the client to reconcile\n    the local state without performing a follow-up sync from the service.  This\n    is intended for \"thin clients\" that need to efficiently support this as\n    a UI operation.\n    \n    @param guid\n      The GUID of the tag to remove from all notes.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Tag.guid\" - if the guid parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Tag\" - user doesn't own tag\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Tag.guid\" - tag not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_untagAll(authenticationToken, guid)\n    self.recv_untagAll()\n\n  def send_untagAll(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('untagAll', TMessageType.CALL, self._seqid)\n    args = untagAll_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_untagAll(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = untagAll_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    return\n\n  def expungeTag(self, authenticationToken, guid):\n    \"\"\"\n    Permanently deletes the tag with the provided GUID, if present.\n    <p/>\n    NOTE: This function is generally not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param guid\n      The GUID of the tag to delete.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Tag.guid\" - if the guid parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Tag\" - user doesn't own tag\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Tag.guid\" - tag not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_expungeTag(authenticationToken, guid)\n    return self.recv_expungeTag()\n\n  def send_expungeTag(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('expungeTag', TMessageType.CALL, self._seqid)\n    args = expungeTag_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_expungeTag(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = expungeTag_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"expungeTag failed: unknown result\");\n\n  def listSearches(self, authenticationToken):\n    \"\"\"\n    Returns a list of the searches in the account.  Evernote does not support\n    the undeletion of searches, so this will only include active searches.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_listSearches(authenticationToken)\n    return self.recv_listSearches()\n\n  def send_listSearches(self, authenticationToken):\n    self._oprot.writeMessageBegin('listSearches', TMessageType.CALL, self._seqid)\n    args = listSearches_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_listSearches(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = listSearches_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"listSearches failed: unknown result\");\n\n  def getSearch(self, authenticationToken, guid):\n    \"\"\"\n    Returns the current state of the search with the provided GUID.\n    \n    @param guid\n      The GUID of the search to be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"SavedSearch.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"SavedSearch\" - private Tag, user doesn't own\n      </li>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"SavedSearch.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_getSearch(authenticationToken, guid)\n    return self.recv_getSearch()\n\n  def send_getSearch(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('getSearch', TMessageType.CALL, self._seqid)\n    args = getSearch_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getSearch(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getSearch_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getSearch failed: unknown result\");\n\n  def createSearch(self, authenticationToken, search):\n    \"\"\"\n    Asks the service to make a saved search with a set of information.\n    \n    @param search\n      The desired list of fields for the search are specified in this\n      object. The caller must specify the name and query for the\n      search, and may optionally specify a search scope.\n      The SavedSearch.format field is ignored by the service.\n    \n    @return\n      The newly created SavedSearch.  The server-side GUID will be\n      saved in this object.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"SavedSearch.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"SavedSearch.query\" - invalid length\n      </li>\n      <li> DATA_CONFLICT \"SavedSearch.name\" - name already in use\n      </li>\n      <li> LIMIT_REACHED \"SavedSearch\" - at max number of searches\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - search\n    \"\"\"\n    self.send_createSearch(authenticationToken, search)\n    return self.recv_createSearch()\n\n  def send_createSearch(self, authenticationToken, search):\n    self._oprot.writeMessageBegin('createSearch', TMessageType.CALL, self._seqid)\n    args = createSearch_args()\n    args.authenticationToken = authenticationToken\n    args.search = search\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_createSearch(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = createSearch_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"createSearch failed: unknown result\");\n\n  def updateSearch(self, authenticationToken, search):\n    \"\"\"\n    Submits search changes to the service. The provided data must include\n    the search's guid field for identification. The service will apply\n    updates to the following search fields: name, query, and scope.\n    \n    @param search\n      The search object containing the requested changes.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"SavedSearch.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"SavedSearch.query\" - invalid length\n      </li>\n      <li> DATA_CONFLICT \"SavedSearch.name\" - name already in use\n      </li>\n      <li> PERMISSION_DENIED \"SavedSearch\" - user doesn't own tag\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"SavedSearch.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - search\n    \"\"\"\n    self.send_updateSearch(authenticationToken, search)\n    return self.recv_updateSearch()\n\n  def send_updateSearch(self, authenticationToken, search):\n    self._oprot.writeMessageBegin('updateSearch', TMessageType.CALL, self._seqid)\n    args = updateSearch_args()\n    args.authenticationToken = authenticationToken\n    args.search = search\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_updateSearch(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = updateSearch_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"updateSearch failed: unknown result\");\n\n  def expungeSearch(self, authenticationToken, guid):\n    \"\"\"\n    Permanently deletes the saved search with the provided GUID, if present.\n    <p/>\n    NOTE: This function is generally not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param guid\n      The GUID of the search to delete.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"SavedSearch.guid\" - if the guid parameter is empty\n      </li>\n      <li> PERMISSION_DENIED \"SavedSearch\" - user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"SavedSearch.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_expungeSearch(authenticationToken, guid)\n    return self.recv_expungeSearch()\n\n  def send_expungeSearch(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('expungeSearch', TMessageType.CALL, self._seqid)\n    args = expungeSearch_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_expungeSearch(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = expungeSearch_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"expungeSearch failed: unknown result\");\n\n  def findNotes(self, authenticationToken, filter, offset, maxNotes):\n    \"\"\"\n    DEPRECATED. Use findNotesMetadata.\n    \n    Parameters:\n     - authenticationToken\n     - filter\n     - offset\n     - maxNotes\n    \"\"\"\n    self.send_findNotes(authenticationToken, filter, offset, maxNotes)\n    return self.recv_findNotes()\n\n  def send_findNotes(self, authenticationToken, filter, offset, maxNotes):\n    self._oprot.writeMessageBegin('findNotes', TMessageType.CALL, self._seqid)\n    args = findNotes_args()\n    args.authenticationToken = authenticationToken\n    args.filter = filter\n    args.offset = offset\n    args.maxNotes = maxNotes\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_findNotes(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = findNotes_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"findNotes failed: unknown result\");\n\n  def findNoteOffset(self, authenticationToken, filter, guid):\n    \"\"\"\n    Finds the position of a note within a sorted subset of all of the user's\n    notes. This may be useful for thin clients that are displaying a paginated\n    listing of a large account, which need to know where a particular note\n    sits in the list without retrieving all notes first.\n    \n    @param authenticationToken\n      Must be a valid token for the user's account unless the NoteFilter\n      'notebookGuid' is the GUID of a public notebook.\n    \n    @param filter\n      The list of criteria that will constrain the notes to be returned.\n    \n    @param guid\n      The GUID of the note to be retrieved.\n    \n    @return\n      If the note with the provided GUID is found within the matching note\n      list, this will return the offset of that note within that list (where\n      the first offset is 0).  If the note is not found within the set of\n      notes, this will return -1.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"offset\" - not between 0 and EDAM_USER_NOTES_MAX\n      </li>\n      <li> BAD_DATA_FORMAT \"maxNotes\" - not between 0 and EDAM_USER_NOTES_MAX\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.notebookGuid\" - if malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.tagGuids\" - if any are malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.words\" - if search string too long\n      </li>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - not found, by GUID\n      </li>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - filter\n     - guid\n    \"\"\"\n    self.send_findNoteOffset(authenticationToken, filter, guid)\n    return self.recv_findNoteOffset()\n\n  def send_findNoteOffset(self, authenticationToken, filter, guid):\n    self._oprot.writeMessageBegin('findNoteOffset', TMessageType.CALL, self._seqid)\n    args = findNoteOffset_args()\n    args.authenticationToken = authenticationToken\n    args.filter = filter\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_findNoteOffset(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = findNoteOffset_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"findNoteOffset failed: unknown result\");\n\n  def findNotesMetadata(self, authenticationToken, filter, offset, maxNotes, resultSpec):\n    \"\"\"\n    Used to find the high-level information about a set of the notes from a\n    user's account based on various criteria specified via a NoteFilter object.\n    <p/>\n    Web applications that wish to periodically check for new content in a user's\n    Evernote account should consider using webhooks instead of polling this API.\n    See http://dev.evernote.com/documentation/cloud/chapters/polling_notification.php\n    for more information.\n    \n    @param authenticationToken\n      Must be a valid token for the user's account unless the NoteFilter\n      'notebookGuid' is the GUID of a public notebook.\n    \n    @param filter\n      The list of criteria that will constrain the notes to be returned.\n    \n    @param offset\n      The numeric index of the first note to show within the sorted\n      results.  The numbering scheme starts with \"0\".  This can be used for\n      pagination.\n    \n    @param maxNotes\n      The mximum notes to return in this query.  The service will return a set\n      of notes that is no larger than this number, but may return fewer notes\n      if needed.  The NoteList.totalNotes field in the return value will\n      indicate whether there are more values available after the returned set.\n    \n    @param resultSpec\n      This specifies which information should be returned for each matching\n      Note. The fields on this structure can be used to eliminate data that\n      the client doesn't need, which will reduce the time and bandwidth\n      to receive and process the reply.\n    \n    @return\n      The list of notes that match the criteria.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"offset\" - not between 0 and EDAM_USER_NOTES_MAX\n      </li>\n      <li> BAD_DATA_FORMAT \"maxNotes\" - not between 0 and EDAM_USER_NOTES_MAX\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.notebookGuid\" - if malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.tagGuids\" - if any are malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.words\" - if search string too long\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - filter\n     - offset\n     - maxNotes\n     - resultSpec\n    \"\"\"\n    self.send_findNotesMetadata(authenticationToken, filter, offset, maxNotes, resultSpec)\n    return self.recv_findNotesMetadata()\n\n  def send_findNotesMetadata(self, authenticationToken, filter, offset, maxNotes, resultSpec):\n    self._oprot.writeMessageBegin('findNotesMetadata', TMessageType.CALL, self._seqid)\n    args = findNotesMetadata_args()\n    args.authenticationToken = authenticationToken\n    args.filter = filter\n    args.offset = offset\n    args.maxNotes = maxNotes\n    args.resultSpec = resultSpec\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_findNotesMetadata(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = findNotesMetadata_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"findNotesMetadata failed: unknown result\");\n\n  def findNoteCounts(self, authenticationToken, filter, withTrash):\n    \"\"\"\n    This function is used to determine how many notes are found for each\n    notebook and tag in the user's account, given a current set of filter\n    parameters that determine the current selection.  This function will\n    return a structure that gives the note count for each notebook and tag\n    that has at least one note under the requested filter.  Any notebook or\n    tag that has zero notes in the filtered set will not be listed in the\n    reply to this function (so they can be assumed to be 0).\n    \n    @param authenticationToken\n      Must be a valid token for the user's account unless the NoteFilter\n      'notebookGuid' is the GUID of a public notebook.\n    \n    @param filter\n      The note selection filter that is currently being applied.  The note\n      counts are to be calculated with this filter applied to the total set\n      of notes in the user's account.\n    \n    @param withTrash\n      If true, then the NoteCollectionCounts.trashCount will be calculated\n      and supplied in the reply. Otherwise, the trash value will be omitted.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"NoteFilter.notebookGuid\" - if malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.notebookGuids\" - if any are malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.words\" - if search string too long\n      </li>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - filter\n     - withTrash\n    \"\"\"\n    self.send_findNoteCounts(authenticationToken, filter, withTrash)\n    return self.recv_findNoteCounts()\n\n  def send_findNoteCounts(self, authenticationToken, filter, withTrash):\n    self._oprot.writeMessageBegin('findNoteCounts', TMessageType.CALL, self._seqid)\n    args = findNoteCounts_args()\n    args.authenticationToken = authenticationToken\n    args.filter = filter\n    args.withTrash = withTrash\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_findNoteCounts(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = findNoteCounts_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"findNoteCounts failed: unknown result\");\n\n  def getNote(self, authenticationToken, guid, withContent, withResourcesData, withResourcesRecognition, withResourcesAlternateData):\n    \"\"\"\n    Returns the current state of the note in the service with the provided\n    GUID.  The ENML contents of the note will only be provided if the\n    'withContent' parameter is true.  The service will include the meta-data\n    for each resource in the note, but the binary contents of the resources\n    and their recognition data will be omitted.\n    If the Note is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).  The applicationData\n    fields are returned as keysOnly.\n    \n    @param guid\n      The GUID of the note to be retrieved.\n    \n    @param withContent\n      If true, the note will include the ENML contents of its\n      'content' field.\n    \n    @param withResourcesData\n      If true, any Resource elements in this Note will include the binary\n      contents of their 'data' field's body.\n    \n    @param withResourcesRecognition\n      If true, any Resource elements will include the binary contents of the\n      'recognition' field's body if recognition data is present.\n    \n    @param withResourcesAlternateData\n      If true, any Resource elements in this Note will include the binary\n      contents of their 'alternateData' fields' body, if an alternate form\n      is present.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - withContent\n     - withResourcesData\n     - withResourcesRecognition\n     - withResourcesAlternateData\n    \"\"\"\n    self.send_getNote(authenticationToken, guid, withContent, withResourcesData, withResourcesRecognition, withResourcesAlternateData)\n    return self.recv_getNote()\n\n  def send_getNote(self, authenticationToken, guid, withContent, withResourcesData, withResourcesRecognition, withResourcesAlternateData):\n    self._oprot.writeMessageBegin('getNote', TMessageType.CALL, self._seqid)\n    args = getNote_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.withContent = withContent\n    args.withResourcesData = withResourcesData\n    args.withResourcesRecognition = withResourcesRecognition\n    args.withResourcesAlternateData = withResourcesAlternateData\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getNote(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getNote_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getNote failed: unknown result\");\n\n  def getNoteApplicationData(self, authenticationToken, guid):\n    \"\"\"\n    Get all of the application data for the note identified by GUID,\n    with values returned within the LazyMap fullMap field.\n    If there are no applicationData entries, then a LazyMap\n    with an empty fullMap will be returned. If your application\n    only needs to fetch its own applicationData entry, use\n    getNoteApplicationDataEntry instead.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_getNoteApplicationData(authenticationToken, guid)\n    return self.recv_getNoteApplicationData()\n\n  def send_getNoteApplicationData(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('getNoteApplicationData', TMessageType.CALL, self._seqid)\n    args = getNoteApplicationData_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getNoteApplicationData(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getNoteApplicationData_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getNoteApplicationData failed: unknown result\");\n\n  def getNoteApplicationDataEntry(self, authenticationToken, guid, key):\n    \"\"\"\n    Get the value of a single entry in the applicationData map\n    for the note identified by GUID.\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - note not found, by GUID</li>\n      <li> \"NoteAttributes.applicationData.key\" - note not found, by key</li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - key\n    \"\"\"\n    self.send_getNoteApplicationDataEntry(authenticationToken, guid, key)\n    return self.recv_getNoteApplicationDataEntry()\n\n  def send_getNoteApplicationDataEntry(self, authenticationToken, guid, key):\n    self._oprot.writeMessageBegin('getNoteApplicationDataEntry', TMessageType.CALL, self._seqid)\n    args = getNoteApplicationDataEntry_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.key = key\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getNoteApplicationDataEntry(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getNoteApplicationDataEntry_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getNoteApplicationDataEntry failed: unknown result\");\n\n  def setNoteApplicationDataEntry(self, authenticationToken, guid, key, value):\n    \"\"\"\n    Update, or create, an entry in the applicationData map for\n    the note identified by guid.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - key\n     - value\n    \"\"\"\n    self.send_setNoteApplicationDataEntry(authenticationToken, guid, key, value)\n    return self.recv_setNoteApplicationDataEntry()\n\n  def send_setNoteApplicationDataEntry(self, authenticationToken, guid, key, value):\n    self._oprot.writeMessageBegin('setNoteApplicationDataEntry', TMessageType.CALL, self._seqid)\n    args = setNoteApplicationDataEntry_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.key = key\n    args.value = value\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_setNoteApplicationDataEntry(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = setNoteApplicationDataEntry_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"setNoteApplicationDataEntry failed: unknown result\");\n\n  def unsetNoteApplicationDataEntry(self, authenticationToken, guid, key):\n    \"\"\"\n    Remove an entry identified by 'key' from the applicationData map for\n    the note identified by 'guid'. Silently ignores an unset of a\n    non-existing key.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - key\n    \"\"\"\n    self.send_unsetNoteApplicationDataEntry(authenticationToken, guid, key)\n    return self.recv_unsetNoteApplicationDataEntry()\n\n  def send_unsetNoteApplicationDataEntry(self, authenticationToken, guid, key):\n    self._oprot.writeMessageBegin('unsetNoteApplicationDataEntry', TMessageType.CALL, self._seqid)\n    args = unsetNoteApplicationDataEntry_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.key = key\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_unsetNoteApplicationDataEntry(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = unsetNoteApplicationDataEntry_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"unsetNoteApplicationDataEntry failed: unknown result\");\n\n  def getNoteContent(self, authenticationToken, guid):\n    \"\"\"\n    Returns XHTML contents of the note with the provided GUID.\n    If the Note is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).\n    \n    @param guid\n      The GUID of the note to be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_getNoteContent(authenticationToken, guid)\n    return self.recv_getNoteContent()\n\n  def send_getNoteContent(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('getNoteContent', TMessageType.CALL, self._seqid)\n    args = getNoteContent_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getNoteContent(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getNoteContent_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getNoteContent failed: unknown result\");\n\n  def getNoteSearchText(self, authenticationToken, guid, noteOnly, tokenizeForIndexing):\n    \"\"\"\n    Returns a block of the extracted plain text contents of the note with the\n    provided GUID.  This text can be indexed for search purposes by a light\n    client that doesn't have capabilities to extract all of the searchable\n    text content from the note and its resources.\n    \n    If the Note is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).\n    \n    @param guid\n      The GUID of the note to be retrieved.\n    \n    @param noteOnly\n      If true, this will only return the text extracted from the ENML contents\n      of the note itself.  If false, this will also include the extracted text\n      from any text-bearing resources (PDF, recognized images)\n    \n    @param tokenizeForIndexing\n      If true, this will break the text into cleanly separated and sanitized\n      tokens.  If false, this will return the more raw text extraction, with\n      its original punctuation, capitalization, spacing, etc.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - noteOnly\n     - tokenizeForIndexing\n    \"\"\"\n    self.send_getNoteSearchText(authenticationToken, guid, noteOnly, tokenizeForIndexing)\n    return self.recv_getNoteSearchText()\n\n  def send_getNoteSearchText(self, authenticationToken, guid, noteOnly, tokenizeForIndexing):\n    self._oprot.writeMessageBegin('getNoteSearchText', TMessageType.CALL, self._seqid)\n    args = getNoteSearchText_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.noteOnly = noteOnly\n    args.tokenizeForIndexing = tokenizeForIndexing\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getNoteSearchText(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getNoteSearchText_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getNoteSearchText failed: unknown result\");\n\n  def getResourceSearchText(self, authenticationToken, guid):\n    \"\"\"\n    Returns a block of the extracted plain text contents of the resource with\n    the provided GUID.  This text can be indexed for search purposes by a light\n    client that doesn't have capability to extract all of the searchable\n    text content from a resource.\n    \n    If the Resource is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).\n    \n    @param guid\n      The GUID of the resource to be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_getResourceSearchText(authenticationToken, guid)\n    return self.recv_getResourceSearchText()\n\n  def send_getResourceSearchText(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('getResourceSearchText', TMessageType.CALL, self._seqid)\n    args = getResourceSearchText_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getResourceSearchText(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getResourceSearchText_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getResourceSearchText failed: unknown result\");\n\n  def getNoteTagNames(self, authenticationToken, guid):\n    \"\"\"\n    Returns a list of the names of the tags for the note with the provided\n    guid.  This can be used with authentication to get the tags for a\n    user's own note, or can be used without valid authentication to retrieve\n    the names of the tags for a note in a public notebook.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_getNoteTagNames(authenticationToken, guid)\n    return self.recv_getNoteTagNames()\n\n  def send_getNoteTagNames(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('getNoteTagNames', TMessageType.CALL, self._seqid)\n    args = getNoteTagNames_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getNoteTagNames(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getNoteTagNames_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getNoteTagNames failed: unknown result\");\n\n  def createNote(self, authenticationToken, note):\n    \"\"\"\n    Asks the service to make a note with the provided set of information.\n    \n    @param note\n      A Note object containing the desired fields to be populated on\n      the service.\n    \n    @return\n      The newly created Note from the service.  The server-side\n      GUIDs for the Note and any Resources will be saved in this object.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.title\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Note.content\" - invalid length for ENML content\n      </li>\n      <li> BAD_DATA_FORMAT \"Resource.mime\" - invalid resource MIME type\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteAttributes.*\" - bad resource string\n      </li>\n      <li> BAD_DATA_FORMAT \"ResourceAttributes.*\" - bad resource string\n      </li>\n      <li> DATA_CONFLICT \"Note.deleted\" - deleted time set on active note\n      </li>\n      <li> DATA_REQUIRED \"Resource.data\" - resource data body missing\n      </li>\n      <li> ENML_VALIDATION \"*\" - note content doesn't validate against DTD\n      </li>\n      <li> LIMIT_REACHED \"Note\" - at max number per account\n      </li>\n      <li> LIMIT_REACHED \"Note.size\" - total note size too large\n      </li>\n      <li> LIMIT_REACHED \"Note.resources\" - too many resources on Note\n      </li>\n      <li> LIMIT_REACHED \"Note.tagGuids\" - too many Tags on Note\n      </li>\n      <li> LIMIT_REACHED \"Resource.data.size\" - resource too large\n      </li>\n      <li> LIMIT_REACHED \"NoteAttribute.*\" - attribute string too long\n      </li>\n      <li> LIMIT_REACHED \"ResourceAttribute.*\" - attribute string too long\n      </li>\n      <li> PERMISSION_DENIED \"Note.notebookGuid\" - NB not owned by user\n      </li>\n      <li> QUOTA_REACHED \"Accounting.uploadLimit\" - note exceeds upload quota\n      </li>\n      <li> BAD_DATA_FORMAT \"Tag.name\" - Note.tagNames was provided, and one\n        of the specified tags had an invalid length or pattern\n      </li>\n      <li> LIMIT_REACHED \"Tag\" - Note.tagNames was provided, and the required\n        new tags would exceed the maximum number per account\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.notebookGuid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - note\n    \"\"\"\n    self.send_createNote(authenticationToken, note)\n    return self.recv_createNote()\n\n  def send_createNote(self, authenticationToken, note):\n    self._oprot.writeMessageBegin('createNote', TMessageType.CALL, self._seqid)\n    args = createNote_args()\n    args.authenticationToken = authenticationToken\n    args.note = note\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_createNote(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = createNote_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"createNote failed: unknown result\");\n\n  def updateNote(self, authenticationToken, note):\n    \"\"\"\n    Submit a set of changes to a note to the service.  The provided data\n    must include the note's guid field for identification. The note's\n    title must also be set.\n    \n    @param note\n      A Note object containing the desired fields to be populated on\n      the service. With the exception of the note's title and guid, fields\n      that are not being changed do not need to be set. If the content is not\n      being modified, note.content should be left unset. If the list of\n      resources is not being modified, note.resources should be left unset.\n    \n    @return\n      The metadata (no contents) for the Note on the server after the update\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.title\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"Note.content\" - invalid length for ENML body\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteAttributes.*\" - bad resource string\n      </li>\n      <li> BAD_DATA_FORMAT \"ResourceAttributes.*\" - bad resource string\n      </li>\n      <li> BAD_DATA_FORMAT \"Resource.mime\" - invalid resource MIME type\n      </li>\n      <li> DATA_CONFLICT \"Note.deleted\" - deleted time set on active note\n      </li>\n      <li> DATA_REQUIRED \"Resource.data\" - resource data body missing\n      </li>\n      <li> ENML_VALIDATION \"*\" - note content doesn't validate against DTD\n      </li>\n      <li> LIMIT_REACHED \"Note.tagGuids\" - too many Tags on Note\n      </li>\n      <li> LIMIT_REACHED \"Note.resources\" - too many resources on Note\n      </li>\n      <li> LIMIT_REACHED \"Note.size\" - total note size too large\n      </li>\n      <li> LIMIT_REACHED \"Resource.data.size\" - resource too large\n      </li>\n      <li> LIMIT_REACHED \"NoteAttribute.*\" - attribute string too long\n      </li>\n      <li> LIMIT_REACHED \"ResourceAttribute.*\" - attribute string too long\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - user doesn't own\n      </li>\n      <li> PERMISSION_DENIED \"Note.notebookGuid\" - user doesn't own destination\n      </li>\n      <li> QUOTA_REACHED \"Accounting.uploadLimit\" - note exceeds upload quota\n      </li>\n      <li> BAD_DATA_FORMAT \"Tag.name\" - Note.tagNames was provided, and one\n        of the specified tags had an invalid length or pattern\n      </li>\n      <li> LIMIT_REACHED \"Tag\" - Note.tagNames was provided, and the required\n        new tags would exceed the maximum number per account\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - note not found, by GUID\n      </li>\n      <li> \"Note.notebookGuid\" - if notebookGuid provided, but not found\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - note\n    \"\"\"\n    self.send_updateNote(authenticationToken, note)\n    return self.recv_updateNote()\n\n  def send_updateNote(self, authenticationToken, note):\n    self._oprot.writeMessageBegin('updateNote', TMessageType.CALL, self._seqid)\n    args = updateNote_args()\n    args.authenticationToken = authenticationToken\n    args.note = note\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_updateNote(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = updateNote_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"updateNote failed: unknown result\");\n\n  def deleteNote(self, authenticationToken, guid):\n    \"\"\"\n    Moves the note into the trash. The note may still be undeleted, unless it\n    is expunged.  This is equivalent to calling updateNote() after setting\n    Note.active = false\n    \n    @param guid\n      The GUID of the note to delete.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> PERMISSION_DENIED \"Note\" - user doesn't have permission to\n             update the note.\n      </li>\n    </ul>\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_CONFLICT \"Note.guid\" - the note is already deleted\n      </li>\n    </ul>\n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_deleteNote(authenticationToken, guid)\n    return self.recv_deleteNote()\n\n  def send_deleteNote(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('deleteNote', TMessageType.CALL, self._seqid)\n    args = deleteNote_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_deleteNote(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = deleteNote_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"deleteNote failed: unknown result\");\n\n  def expungeNote(self, authenticationToken, guid):\n    \"\"\"\n    Permanently removes a Note, and all of its Resources,\n    from the service.\n    <p/>\n    NOTE: This function is not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param guid\n      The GUID of the note to delete.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> PERMISSION_DENIED \"Note\" - user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_expungeNote(authenticationToken, guid)\n    return self.recv_expungeNote()\n\n  def send_expungeNote(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('expungeNote', TMessageType.CALL, self._seqid)\n    args = expungeNote_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_expungeNote(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = expungeNote_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"expungeNote failed: unknown result\");\n\n  def expungeNotes(self, authenticationToken, noteGuids):\n    \"\"\"\n    Permanently removes a list of Notes, and all of their Resources, from\n    the service.  This should be invoked with a small number of Note GUIDs\n    (e.g. 100 or less) on each call.  To expunge a larger number of notes,\n    call this method multiple times.  This should also be used to reduce the\n    number of Notes in a notebook before calling expungeNotebook() or\n    in the trash before calling expungeInactiveNotes(), since these calls may\n    be prohibitively slow if there are more than a few hundred notes.\n    If an exception is thrown for any of the GUIDs, then none of the notes\n    will be deleted.  I.e. this call can be treated as an atomic transaction.\n    <p/>\n    NOTE: This function is not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param noteGuids\n      The list of GUIDs for the Notes to remove.\n    \n    @return\n      The account's updateCount at the end of this operation\n    \n    @throws EDAMUserException <ul>\n      <li> PERMISSION_DENIED \"Note\" - user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - noteGuids\n    \"\"\"\n    self.send_expungeNotes(authenticationToken, noteGuids)\n    return self.recv_expungeNotes()\n\n  def send_expungeNotes(self, authenticationToken, noteGuids):\n    self._oprot.writeMessageBegin('expungeNotes', TMessageType.CALL, self._seqid)\n    args = expungeNotes_args()\n    args.authenticationToken = authenticationToken\n    args.noteGuids = noteGuids\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_expungeNotes(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = expungeNotes_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"expungeNotes failed: unknown result\");\n\n  def expungeInactiveNotes(self, authenticationToken):\n    \"\"\"\n    Permanently removes all of the Notes that are currently marked as\n    inactive.  This is equivalent to \"emptying the trash\", and these Notes\n    will be gone permanently.\n    <p/>\n    This operation may be relatively slow if the account contains a large\n    number of inactive Notes.\n    <p/>\n    NOTE: This function is not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @return\n       The number of notes that were expunged.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_expungeInactiveNotes(authenticationToken)\n    return self.recv_expungeInactiveNotes()\n\n  def send_expungeInactiveNotes(self, authenticationToken):\n    self._oprot.writeMessageBegin('expungeInactiveNotes', TMessageType.CALL, self._seqid)\n    args = expungeInactiveNotes_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_expungeInactiveNotes(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = expungeInactiveNotes_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"expungeInactiveNotes failed: unknown result\");\n\n  def copyNote(self, authenticationToken, noteGuid, toNotebookGuid):\n    \"\"\"\n    Performs a deep copy of the Note with the provided GUID 'noteGuid' into\n    the Notebook with the provided GUID 'toNotebookGuid'.\n    The caller must be the owner of both the Note and the Notebook.\n    This creates a new Note in the destination Notebook with new content and\n    Resources that match all of the content and Resources from the original\n    Note, but with new GUID identifiers.\n    The original Note is not modified by this operation.\n    The copied note is considered as an \"upload\" for the purpose of upload\n    transfer limit calculation, so its size is added to the upload count for\n    the owner.\n    \n    @param noteGuid\n      The GUID of the Note to copy.\n    \n    @param toNotebookGuid\n      The GUID of the Notebook that should receive the new Note.\n    \n    @return\n      The metadata for the new Note that was created.  This will include the\n      new GUID for this Note (and any copied Resources), but will not include\n      the content body or the binary bodies of any Resources.\n    \n    @throws EDAMUserException <ul>\n      <li> LIMIT_REACHED \"Note\" - at max number per account\n      </li>\n      <li> PERMISSION_DENIED \"Notebook.guid\" - destination not owned by user\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - user doesn't own\n      </li>\n      <li> QUOTA_REACHED \"Accounting.uploadLimit\" - note exceeds upload quota\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - noteGuid\n     - toNotebookGuid\n    \"\"\"\n    self.send_copyNote(authenticationToken, noteGuid, toNotebookGuid)\n    return self.recv_copyNote()\n\n  def send_copyNote(self, authenticationToken, noteGuid, toNotebookGuid):\n    self._oprot.writeMessageBegin('copyNote', TMessageType.CALL, self._seqid)\n    args = copyNote_args()\n    args.authenticationToken = authenticationToken\n    args.noteGuid = noteGuid\n    args.toNotebookGuid = toNotebookGuid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_copyNote(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = copyNote_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"copyNote failed: unknown result\");\n\n  def listNoteVersions(self, authenticationToken, noteGuid):\n    \"\"\"\n    Returns a list of the prior versions of a particular note that are\n    saved within the service.  These prior versions are stored to provide a\n    recovery from unintentional removal of content from a note. The identifiers\n    that are returned by this call can be used with getNoteVersion to retrieve\n    the previous note.\n    The identifiers will be listed from the most recent versions to the oldest.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - noteGuid\n    \"\"\"\n    self.send_listNoteVersions(authenticationToken, noteGuid)\n    return self.recv_listNoteVersions()\n\n  def send_listNoteVersions(self, authenticationToken, noteGuid):\n    self._oprot.writeMessageBegin('listNoteVersions', TMessageType.CALL, self._seqid)\n    args = listNoteVersions_args()\n    args.authenticationToken = authenticationToken\n    args.noteGuid = noteGuid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_listNoteVersions(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = listNoteVersions_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"listNoteVersions failed: unknown result\");\n\n  def getNoteVersion(self, authenticationToken, noteGuid, updateSequenceNum, withResourcesData, withResourcesRecognition, withResourcesAlternateData):\n    \"\"\"\n    This can be used to retrieve a previous version of a Note after it has been\n    updated within the service.  The caller must identify the note (via its\n    guid) and the version (via the updateSequenceNumber of that version).\n    to find a listing of the stored version USNs for a note, call\n    listNoteVersions.\n    This call is only available for notes in Premium accounts.  (I.e. access\n    to past versions of Notes is a Premium-only feature.)\n    \n    @param noteGuid\n      The GUID of the note to be retrieved.\n    \n    @param updateSequenceNum\n      The USN of the version of the note that is being retrieved\n    \n    @param withResourcesData\n      If true, any Resource elements in this Note will include the binary\n      contents of their 'data' field's body.\n    \n    @param withResourcesRecognition\n      If true, any Resource elements will include the binary contents of the\n      'recognition' field's body if recognition data is present.\n    \n    @param withResourcesAlternateData\n      If true, any Resource elements in this Note will include the binary\n      contents of their 'alternateData' fields' body, if an alternate form\n      is present.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n      <li> PERMISSION_DENIED \"updateSequenceNum\" -\n        The account isn't permitted to access previous versions of notes.\n        (i.e. this is a Free account.)\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n      <li> \"Note.updateSequenceNumber\" - the Note doesn't have a version with\n         the corresponding USN.\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - noteGuid\n     - updateSequenceNum\n     - withResourcesData\n     - withResourcesRecognition\n     - withResourcesAlternateData\n    \"\"\"\n    self.send_getNoteVersion(authenticationToken, noteGuid, updateSequenceNum, withResourcesData, withResourcesRecognition, withResourcesAlternateData)\n    return self.recv_getNoteVersion()\n\n  def send_getNoteVersion(self, authenticationToken, noteGuid, updateSequenceNum, withResourcesData, withResourcesRecognition, withResourcesAlternateData):\n    self._oprot.writeMessageBegin('getNoteVersion', TMessageType.CALL, self._seqid)\n    args = getNoteVersion_args()\n    args.authenticationToken = authenticationToken\n    args.noteGuid = noteGuid\n    args.updateSequenceNum = updateSequenceNum\n    args.withResourcesData = withResourcesData\n    args.withResourcesRecognition = withResourcesRecognition\n    args.withResourcesAlternateData = withResourcesAlternateData\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getNoteVersion(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getNoteVersion_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getNoteVersion failed: unknown result\");\n\n  def getResource(self, authenticationToken, guid, withData, withRecognition, withAttributes, withAlternateData):\n    \"\"\"\n    Returns the current state of the resource in the service with the\n    provided GUID.\n    If the Resource is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).  Only the\n    keys for the applicationData will be returned.\n    \n    @param guid\n      The GUID of the resource to be retrieved.\n    \n    @param withData\n      If true, the Resource will include the binary contents of the\n      'data' field's body.\n    \n    @param withRecognition\n      If true, the Resource will include the binary contents of the\n      'recognition' field's body if recognition data is present.\n    \n    @param withAttributes\n      If true, the Resource will include the attributes\n    \n    @param withAlternateData\n      If true, the Resource will include the binary contents of the\n      'alternateData' field's body, if an alternate form is present.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - withData\n     - withRecognition\n     - withAttributes\n     - withAlternateData\n    \"\"\"\n    self.send_getResource(authenticationToken, guid, withData, withRecognition, withAttributes, withAlternateData)\n    return self.recv_getResource()\n\n  def send_getResource(self, authenticationToken, guid, withData, withRecognition, withAttributes, withAlternateData):\n    self._oprot.writeMessageBegin('getResource', TMessageType.CALL, self._seqid)\n    args = getResource_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.withData = withData\n    args.withRecognition = withRecognition\n    args.withAttributes = withAttributes\n    args.withAlternateData = withAlternateData\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getResource(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getResource_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getResource failed: unknown result\");\n\n  def getResourceApplicationData(self, authenticationToken, guid):\n    \"\"\"\n    Get all of the application data for the Resource identified by GUID,\n    with values returned within the LazyMap fullMap field.\n    If there are no applicationData entries, then a LazyMap\n    with an empty fullMap will be returned. If your application\n    only needs to fetch its own applicationData entry, use\n    getResourceApplicationDataEntry instead.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_getResourceApplicationData(authenticationToken, guid)\n    return self.recv_getResourceApplicationData()\n\n  def send_getResourceApplicationData(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('getResourceApplicationData', TMessageType.CALL, self._seqid)\n    args = getResourceApplicationData_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getResourceApplicationData(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getResourceApplicationData_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getResourceApplicationData failed: unknown result\");\n\n  def getResourceApplicationDataEntry(self, authenticationToken, guid, key):\n    \"\"\"\n    Get the value of a single entry in the applicationData map\n    for the Resource identified by GUID.\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - Resource not found, by GUID</li>\n      <li> \"ResourceAttributes.applicationData.key\" - Resource not found, by key</li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - key\n    \"\"\"\n    self.send_getResourceApplicationDataEntry(authenticationToken, guid, key)\n    return self.recv_getResourceApplicationDataEntry()\n\n  def send_getResourceApplicationDataEntry(self, authenticationToken, guid, key):\n    self._oprot.writeMessageBegin('getResourceApplicationDataEntry', TMessageType.CALL, self._seqid)\n    args = getResourceApplicationDataEntry_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.key = key\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getResourceApplicationDataEntry(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getResourceApplicationDataEntry_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getResourceApplicationDataEntry failed: unknown result\");\n\n  def setResourceApplicationDataEntry(self, authenticationToken, guid, key, value):\n    \"\"\"\n    Update, or create, an entry in the applicationData map for\n    the Resource identified by guid.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - key\n     - value\n    \"\"\"\n    self.send_setResourceApplicationDataEntry(authenticationToken, guid, key, value)\n    return self.recv_setResourceApplicationDataEntry()\n\n  def send_setResourceApplicationDataEntry(self, authenticationToken, guid, key, value):\n    self._oprot.writeMessageBegin('setResourceApplicationDataEntry', TMessageType.CALL, self._seqid)\n    args = setResourceApplicationDataEntry_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.key = key\n    args.value = value\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_setResourceApplicationDataEntry(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = setResourceApplicationDataEntry_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"setResourceApplicationDataEntry failed: unknown result\");\n\n  def unsetResourceApplicationDataEntry(self, authenticationToken, guid, key):\n    \"\"\"\n    Remove an entry identified by 'key' from the applicationData map for\n    the Resource identified by 'guid'.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n     - key\n    \"\"\"\n    self.send_unsetResourceApplicationDataEntry(authenticationToken, guid, key)\n    return self.recv_unsetResourceApplicationDataEntry()\n\n  def send_unsetResourceApplicationDataEntry(self, authenticationToken, guid, key):\n    self._oprot.writeMessageBegin('unsetResourceApplicationDataEntry', TMessageType.CALL, self._seqid)\n    args = unsetResourceApplicationDataEntry_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.key = key\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_unsetResourceApplicationDataEntry(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = unsetResourceApplicationDataEntry_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"unsetResourceApplicationDataEntry failed: unknown result\");\n\n  def updateResource(self, authenticationToken, resource):\n    \"\"\"\n    Submit a set of changes to a resource to the service.  This can be used\n    to update the meta-data about the resource, but cannot be used to change\n    the binary contents of the resource (including the length and hash).  These\n    cannot be changed directly without creating a new resource and removing the\n    old one via updateNote.\n    \n    @param resource\n      A Resource object containing the desired fields to be populated on\n      the service.  The service will attempt to update the resource with the\n      following fields from the client:\n      <ul>\n         <li>guid:  must be provided to identify the resource\n         </li>\n         <li>mime\n         </li>\n         <li>width\n         </li>\n         <li>height\n         </li>\n         <li>duration\n         </li>\n         <li>attributes:  optional.  if present, the set of attributes will\n              be replaced.\n         </li>\n      </ul>\n    \n    @return\n      The Update Sequence Number of the resource after the changes have been\n      applied.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> BAD_DATA_FORMAT \"Resource.mime\" - invalid resource MIME type\n      </li>\n      <li> BAD_DATA_FORMAT \"ResourceAttributes.*\" - bad resource string\n      </li>\n      <li> LIMIT_REACHED \"ResourceAttribute.*\" - attribute string too long\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - resource\n    \"\"\"\n    self.send_updateResource(authenticationToken, resource)\n    return self.recv_updateResource()\n\n  def send_updateResource(self, authenticationToken, resource):\n    self._oprot.writeMessageBegin('updateResource', TMessageType.CALL, self._seqid)\n    args = updateResource_args()\n    args.authenticationToken = authenticationToken\n    args.resource = resource\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_updateResource(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = updateResource_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"updateResource failed: unknown result\");\n\n  def getResourceData(self, authenticationToken, guid):\n    \"\"\"\n    Returns binary data of the resource with the provided GUID.  For\n    example, if this were an image resource, this would contain the\n    raw bits of the image.\n    If the Resource is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).\n    \n    @param guid\n      The GUID of the resource to be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_getResourceData(authenticationToken, guid)\n    return self.recv_getResourceData()\n\n  def send_getResourceData(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('getResourceData', TMessageType.CALL, self._seqid)\n    args = getResourceData_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getResourceData(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getResourceData_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getResourceData failed: unknown result\");\n\n  def getResourceByHash(self, authenticationToken, noteGuid, contentHash, withData, withRecognition, withAlternateData):\n    \"\"\"\n    Returns the current state of a resource, referenced by containing\n    note GUID and resource content hash.\n    \n    @param noteGuid\n      The GUID of the note that holds the resource to be retrieved.\n    \n    @param contentHash\n      The MD5 checksum of the resource within that note. Note that\n      this is the binary checksum, for example from Resource.data.bodyHash,\n      and not the hex-encoded checksum that is used within an en-media\n      tag in a note body.\n    \n    @param withData\n      If true, the Resource will include the binary contents of the\n      'data' field's body.\n    \n    @param withRecognition\n      If true, the Resource will include the binary contents of the\n      'recognition' field's body.\n    \n    @param withAlternateData\n      If true, the Resource will include the binary contents of the\n      'alternateData' field's body, if an alternate form is present.\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"Note.guid\" - noteGuid param missing\n      </li>\n      <li> DATA_REQUIRED \"Note.contentHash\" - contentHash param missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note\" - not found, by guid\n      </li>\n      <li> \"Resource\" - not found, by hash\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - noteGuid\n     - contentHash\n     - withData\n     - withRecognition\n     - withAlternateData\n    \"\"\"\n    self.send_getResourceByHash(authenticationToken, noteGuid, contentHash, withData, withRecognition, withAlternateData)\n    return self.recv_getResourceByHash()\n\n  def send_getResourceByHash(self, authenticationToken, noteGuid, contentHash, withData, withRecognition, withAlternateData):\n    self._oprot.writeMessageBegin('getResourceByHash', TMessageType.CALL, self._seqid)\n    args = getResourceByHash_args()\n    args.authenticationToken = authenticationToken\n    args.noteGuid = noteGuid\n    args.contentHash = contentHash\n    args.withData = withData\n    args.withRecognition = withRecognition\n    args.withAlternateData = withAlternateData\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getResourceByHash(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getResourceByHash_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getResourceByHash failed: unknown result\");\n\n  def getResourceRecognition(self, authenticationToken, guid):\n    \"\"\"\n    Returns the binary contents of the recognition index for the resource\n    with the provided GUID.  If the caller asks about a resource that has\n    no recognition data, this will throw EDAMNotFoundException.\n    If the Resource is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).\n    \n    @param guid\n      The GUID of the resource whose recognition data should be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n      <li> \"Resource.recognition\" - resource has no recognition\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_getResourceRecognition(authenticationToken, guid)\n    return self.recv_getResourceRecognition()\n\n  def send_getResourceRecognition(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('getResourceRecognition', TMessageType.CALL, self._seqid)\n    args = getResourceRecognition_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getResourceRecognition(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getResourceRecognition_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getResourceRecognition failed: unknown result\");\n\n  def getResourceAlternateData(self, authenticationToken, guid):\n    \"\"\"\n    If the Resource with the provided GUID has an alternate data representation\n    (indicated via the Resource.alternateData field), then this request can\n    be used to retrieve the binary contents of that alternate data file.\n    If the caller asks about a resource that has no alternate data form, this\n    will throw EDAMNotFoundException.\n    \n    @param guid\n       The GUID of the resource whose recognition data should be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n      <li> \"Resource.alternateData\" - resource has no recognition\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_getResourceAlternateData(authenticationToken, guid)\n    return self.recv_getResourceAlternateData()\n\n  def send_getResourceAlternateData(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('getResourceAlternateData', TMessageType.CALL, self._seqid)\n    args = getResourceAlternateData_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getResourceAlternateData(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getResourceAlternateData_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getResourceAlternateData failed: unknown result\");\n\n  def getResourceAttributes(self, authenticationToken, guid):\n    \"\"\"\n    Returns the set of attributes for the Resource with the provided GUID.\n    If the Resource is found in a public notebook, the authenticationToken\n    will be ignored (so it could be an empty string).\n    \n    @param guid\n      The GUID of the resource whose attributes should be retrieved.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Resource.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Resource\" - private resource, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Resource.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_getResourceAttributes(authenticationToken, guid)\n    return self.recv_getResourceAttributes()\n\n  def send_getResourceAttributes(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('getResourceAttributes', TMessageType.CALL, self._seqid)\n    args = getResourceAttributes_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getResourceAttributes(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getResourceAttributes_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getResourceAttributes failed: unknown result\");\n\n  def getPublicNotebook(self, userId, publicUri):\n    \"\"\"\n    <p>\n    Looks for a user account with the provided userId on this NoteStore\n    shard and determines whether that account contains a public notebook\n    with the given URI.  If the account is not found, or no public notebook\n    exists with this URI, this will throw an EDAMNotFoundException,\n    otherwise this will return the information for that Notebook.\n    </p>\n    <p>\n    If a notebook is visible on the web with a full URL like\n    http://www.evernote.com/pub/sethdemo/api\n    Then 'sethdemo' is the username that can be used to look up the userId,\n    and 'api' is the publicUri.\n    </p>\n    \n    @param userId\n       The numeric identifier for the user who owns the public notebook.\n       To find this value based on a username string, you can invoke\n       UserStore.getPublicUserInfo\n    \n    @param publicUri\n       The uri string for the public notebook, from Notebook.publishing.uri.\n    \n    @throws EDAMNotFoundException <ul>\n      <li>\"Publishing.uri\" - not found, by URI</li>\n    </ul>\n    \n    @throws EDAMSystemException <ul>\n      <li> TAKEN_DOWN \"PublicNotebook\" - The specified public notebook is\n        taken down (for all requesters).</li>\n      <li> TAKEN_DOWN \"Country\" - The specified public notebook is taken\n        down for the requester because of an IP-based country lookup.</li>\n    </ul>\n    \n    Parameters:\n     - userId\n     - publicUri\n    \"\"\"\n    self.send_getPublicNotebook(userId, publicUri)\n    return self.recv_getPublicNotebook()\n\n  def send_getPublicNotebook(self, userId, publicUri):\n    self._oprot.writeMessageBegin('getPublicNotebook', TMessageType.CALL, self._seqid)\n    args = getPublicNotebook_args()\n    args.userId = userId\n    args.publicUri = publicUri\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getPublicNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getPublicNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getPublicNotebook failed: unknown result\");\n\n  def createSharedNotebook(self, authenticationToken, sharedNotebook):\n    \"\"\"\n    Used to construct a shared notebook object. The constructed notebook will\n    contain a \"share key\" which serve as a unique identifer and access token\n    for a user to access the notebook of the shared notebook owner.\n    \n    @param sharedNotebook\n      A shared notebook object populated with the email address of the share\n      recipient, the notebook guid and the access permissions. All other\n      attributes of the shared object are ignored. The SharedNotebook.allowPreview\n      field must be explicitly set with either a true or false value.\n    \n    @return\n      The fully populated SharedNotebook object including the server assigned\n      share id and shareKey which can both be used to uniquely identify the\n      SharedNotebook.\n    \n    @throws EDAMUserException <ul>\n      <li>BAD_DATA_FORMAT \"SharedNotebook.email\" - if the email was not valid</li>\n      <li>BAD_DATA_FORMAT \"requireLogin\" - if the SharedNotebook.allowPreview field was\n          not set, and the SharedNotebook.requireLogin was also not set or was set to\n          false.</li>\n      <li>PERMISSION_DENIED \"SharedNotebook.recipientSettings\" - if\n          recipientSettings is set in the sharedNotebook.  Only the recipient\n          can set these values via the setSharedNotebookRecipientSettings\n          method.\n      </li>\n      </ul>\n    @throws EDAMNotFoundException <ul>\n      <li>Notebook.guid - if the notebookGuid is not a valid GUID for the user.\n      </li>\n      </ul>\n    \n    Parameters:\n     - authenticationToken\n     - sharedNotebook\n    \"\"\"\n    self.send_createSharedNotebook(authenticationToken, sharedNotebook)\n    return self.recv_createSharedNotebook()\n\n  def send_createSharedNotebook(self, authenticationToken, sharedNotebook):\n    self._oprot.writeMessageBegin('createSharedNotebook', TMessageType.CALL, self._seqid)\n    args = createSharedNotebook_args()\n    args.authenticationToken = authenticationToken\n    args.sharedNotebook = sharedNotebook\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_createSharedNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = createSharedNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"createSharedNotebook failed: unknown result\");\n\n  def updateSharedNotebook(self, authenticationToken, sharedNotebook):\n    \"\"\"\n    Update a SharedNotebook object.\n    \n    @param authenticationToken\n      Must be an authentication token from the owner or a shared notebook\n      authentication token or business authentication token with sufficient\n      permissions to change invitations for a notebook.\n    \n    @param sharedNotebook\n     The SharedNotebook object containing the requested changes.\n     The \"id\" of the shared notebook must be set to allow the service\n     to identify the SharedNotebook to be updated. In addition, you MUST set\n     the email, permission, and allowPreview fields to the desired values.\n     All other fields will be ignored if set.\n    \n    @return\n     The Update Serial Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li>UNSUPPORTED_OPERATION \"updateSharedNotebook\" - if this service instance does not support shared notebooks.</li>\n      <li>BAD_DATA_FORMAT \"SharedNotebook.email\" - if the email was not valid.</li>\n      <li>DATA_REQUIRED \"SharedNotebook.id\" - if the id field was not set.</li>\n      <li>DATA_REQUIRED \"SharedNotebook.privilege\" - if the privilege field was not set.</li>\n      <li>DATA_REQUIRED \"SharedNotebook.allowPreview\" - if the allowPreview field was not set.</li>\n      </ul>\n    @throws EDAMNotFoundException <ul>\n      <li>SharedNotebook.id - if no shared notebook with the specified ID was found.\n      </ul>\n    \n    Parameters:\n     - authenticationToken\n     - sharedNotebook\n    \"\"\"\n    self.send_updateSharedNotebook(authenticationToken, sharedNotebook)\n    return self.recv_updateSharedNotebook()\n\n  def send_updateSharedNotebook(self, authenticationToken, sharedNotebook):\n    self._oprot.writeMessageBegin('updateSharedNotebook', TMessageType.CALL, self._seqid)\n    args = updateSharedNotebook_args()\n    args.authenticationToken = authenticationToken\n    args.sharedNotebook = sharedNotebook\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_updateSharedNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = updateSharedNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"updateSharedNotebook failed: unknown result\");\n\n  def setSharedNotebookRecipientSettings(self, authenticationToken, sharedNotebookId, recipientSettings):\n    \"\"\"\n    Set values for the recipient settings associated with a shared notebook.  Having\n    update rights to the shared notebook record itself has no effect on this call;\n    only the recipient of the shared notebook can can the recipient settings.\n    \n    If you do <i>not</i> wish to, or cannot, change one of the reminderNotifyEmail or\n    reminderNotifyInApp fields, you must leave that field unset in recipientSettings.\n    This method will skip that field for updates and leave the existing state as\n    it is.\n    \n    @return The update sequence number of the account to which the shared notebook\n      belongs, which is the account from which we are sharing a notebook.\n    \n    @throws EDAMNotFoundException \"sharedNotebookId\" - Thrown if the service does not\n      have a shared notebook record for the sharedNotebookId on the given shard.  If you\n      receive this exception, it is probable that the shared notebook record has\n      been revoked or expired, or that you accessed the wrong shard.\n    \n    @throws EDAMUserException <ul>\n      <li>PEMISSION_DENIED \"authenticationToken\" - If you do not have permission to set\n          the recipient settings for the shared notebook.  Only the recipient has\n          permission to do this.\n      <li>DATA_CONFLICT \"recipientSettings.reminderNotifyEmail\" - Setting whether\n          or not you want to receive reminder e-mail notifications is possible on\n          a business notebook in the business to which the user belongs.  All\n          others can safely unset the reminderNotifyEmail field from the\n          recipientSettings parameter.\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - sharedNotebookId\n     - recipientSettings\n    \"\"\"\n    self.send_setSharedNotebookRecipientSettings(authenticationToken, sharedNotebookId, recipientSettings)\n    return self.recv_setSharedNotebookRecipientSettings()\n\n  def send_setSharedNotebookRecipientSettings(self, authenticationToken, sharedNotebookId, recipientSettings):\n    self._oprot.writeMessageBegin('setSharedNotebookRecipientSettings', TMessageType.CALL, self._seqid)\n    args = setSharedNotebookRecipientSettings_args()\n    args.authenticationToken = authenticationToken\n    args.sharedNotebookId = sharedNotebookId\n    args.recipientSettings = recipientSettings\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_setSharedNotebookRecipientSettings(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = setSharedNotebookRecipientSettings_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"setSharedNotebookRecipientSettings failed: unknown result\");\n\n  def sendMessageToSharedNotebookMembers(self, authenticationToken, notebookGuid, messageText, recipients):\n    \"\"\"\n    Send a reminder message to some or all of the email addresses that a notebook has been\n    shared with. The message includes the current link to view the notebook.\n    @param authenticationToken\n      The auth token of the user with permissions to share the notebook\n    @param notebookGuid\n      The guid of the shared notebook\n    @param messageText\n     User provided text to include in the email\n    @param recipients\n     The email addresses of the recipients. If this list is empty then all of the\n     users that the notebook has been shared with are emailed.\n     If an email address doesn't correspond to share invite members then that address\n     is ignored.\n    @return\n     The number of messages sent\n    @throws EDAMUserException <ul>\n      <li> LIMIT_REACHED \"(recipients)\" -\n        The email can't be sent because this would exceed the user's daily\n        email limit.\n      </li>\n      <li> PERMISSION_DENIED \"Notebook.guid\" - The user doesn't have permission to\n        send a message for the specified notebook.\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Notebook.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - notebookGuid\n     - messageText\n     - recipients\n    \"\"\"\n    self.send_sendMessageToSharedNotebookMembers(authenticationToken, notebookGuid, messageText, recipients)\n    return self.recv_sendMessageToSharedNotebookMembers()\n\n  def send_sendMessageToSharedNotebookMembers(self, authenticationToken, notebookGuid, messageText, recipients):\n    self._oprot.writeMessageBegin('sendMessageToSharedNotebookMembers', TMessageType.CALL, self._seqid)\n    args = sendMessageToSharedNotebookMembers_args()\n    args.authenticationToken = authenticationToken\n    args.notebookGuid = notebookGuid\n    args.messageText = messageText\n    args.recipients = recipients\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_sendMessageToSharedNotebookMembers(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = sendMessageToSharedNotebookMembers_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"sendMessageToSharedNotebookMembers failed: unknown result\");\n\n  def listSharedNotebooks(self, authenticationToken):\n    \"\"\"\n    Lists the collection of shared notebooks for all notebooks in the\n    users account.\n    \n    @return\n     The list of all SharedNotebooks for the user\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_listSharedNotebooks(authenticationToken)\n    return self.recv_listSharedNotebooks()\n\n  def send_listSharedNotebooks(self, authenticationToken):\n    self._oprot.writeMessageBegin('listSharedNotebooks', TMessageType.CALL, self._seqid)\n    args = listSharedNotebooks_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_listSharedNotebooks(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = listSharedNotebooks_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"listSharedNotebooks failed: unknown result\");\n\n  def expungeSharedNotebooks(self, authenticationToken, sharedNotebookIds):\n    \"\"\"\n    Expunges the SharedNotebooks in the user's account using the\n    SharedNotebook.id as the identifier.\n    <p/>\n    NOTE: This function is generally not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param\n      sharedNotebookIds - a list of ShardNotebook.id longs identifying the\n          objects to delete permanently.\n    \n    @return\n      The account's update sequence number.\n    \n    Parameters:\n     - authenticationToken\n     - sharedNotebookIds\n    \"\"\"\n    self.send_expungeSharedNotebooks(authenticationToken, sharedNotebookIds)\n    return self.recv_expungeSharedNotebooks()\n\n  def send_expungeSharedNotebooks(self, authenticationToken, sharedNotebookIds):\n    self._oprot.writeMessageBegin('expungeSharedNotebooks', TMessageType.CALL, self._seqid)\n    args = expungeSharedNotebooks_args()\n    args.authenticationToken = authenticationToken\n    args.sharedNotebookIds = sharedNotebookIds\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_expungeSharedNotebooks(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = expungeSharedNotebooks_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"expungeSharedNotebooks failed: unknown result\");\n\n  def createLinkedNotebook(self, authenticationToken, linkedNotebook):\n    \"\"\"\n    Asks the service to make a linked notebook with the provided name, username\n    of the owner and identifiers provided. A linked notebook can be either a\n    link to a public notebook or to a private shared notebook.\n    \n    @param linkedNotebook\n      The desired fields for the linked notebook must be provided on this\n      object.  The name of the linked notebook must be set. Either a username\n      uri or a shard id and share key must be provided otherwise a\n      EDAMUserException is thrown.\n    \n    @return\n      The newly created LinkedNotebook.  The server-side id will be\n      saved in this object's 'id' field.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"LinkedNotebook.name\" - invalid length or pattern\n      </li>\n      <li> BAD_DATA_FORMAT \"LinkedNotebook.username\" - bad username format\n      </li>\n      <li> BAD_DATA_FORMAT \"LinkedNotebook.uri\" -\n        if public notebook set but bad uri\n      </li>\n      <li> BAD_DATA_FORMAT \"LinkedNotebook.shareKey\" -\n        if private notebook set but bad shareKey\n      </li>\n      <li> DATA_REQUIRED \"LinkedNotebook.shardId\" -\n        if private notebook but shard id not provided\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - linkedNotebook\n    \"\"\"\n    self.send_createLinkedNotebook(authenticationToken, linkedNotebook)\n    return self.recv_createLinkedNotebook()\n\n  def send_createLinkedNotebook(self, authenticationToken, linkedNotebook):\n    self._oprot.writeMessageBegin('createLinkedNotebook', TMessageType.CALL, self._seqid)\n    args = createLinkedNotebook_args()\n    args.authenticationToken = authenticationToken\n    args.linkedNotebook = linkedNotebook\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_createLinkedNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = createLinkedNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"createLinkedNotebook failed: unknown result\");\n\n  def updateLinkedNotebook(self, authenticationToken, linkedNotebook):\n    \"\"\"\n    @param linkedNotebook\n      Updates the name of a linked notebook.\n    \n    @return\n      The Update Sequence Number for this change within the account.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"LinkedNotebook.name\" - invalid length or pattern\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - linkedNotebook\n    \"\"\"\n    self.send_updateLinkedNotebook(authenticationToken, linkedNotebook)\n    return self.recv_updateLinkedNotebook()\n\n  def send_updateLinkedNotebook(self, authenticationToken, linkedNotebook):\n    self._oprot.writeMessageBegin('updateLinkedNotebook', TMessageType.CALL, self._seqid)\n    args = updateLinkedNotebook_args()\n    args.authenticationToken = authenticationToken\n    args.linkedNotebook = linkedNotebook\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_updateLinkedNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = updateLinkedNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"updateLinkedNotebook failed: unknown result\");\n\n  def listLinkedNotebooks(self, authenticationToken):\n    \"\"\"\n    Returns a list of linked notebooks\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_listLinkedNotebooks(authenticationToken)\n    return self.recv_listLinkedNotebooks()\n\n  def send_listLinkedNotebooks(self, authenticationToken):\n    self._oprot.writeMessageBegin('listLinkedNotebooks', TMessageType.CALL, self._seqid)\n    args = listLinkedNotebooks_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_listLinkedNotebooks(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = listLinkedNotebooks_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"listLinkedNotebooks failed: unknown result\");\n\n  def expungeLinkedNotebook(self, authenticationToken, guid):\n    \"\"\"\n    Permanently expunges the linked notebook from the account.\n    <p/>\n    NOTE: This function is generally not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param guid\n      The LinkedNotebook.guid field of the LinkedNotebook to permanently remove\n      from the account.\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_expungeLinkedNotebook(authenticationToken, guid)\n    return self.recv_expungeLinkedNotebook()\n\n  def send_expungeLinkedNotebook(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('expungeLinkedNotebook', TMessageType.CALL, self._seqid)\n    args = expungeLinkedNotebook_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_expungeLinkedNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = expungeLinkedNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"expungeLinkedNotebook failed: unknown result\");\n\n  def authenticateToSharedNotebook(self, shareKey, authenticationToken):\n    \"\"\"\n    Asks the service to produce an authentication token that can be used to\n    access the contents of a shared notebook from someone else's account.\n    This authenticationToken can be used with the various other NoteStore\n    calls to find and retrieve notes, and if the permissions in the shared\n    notebook are sufficient, to make changes to the contents of the notebook.\n    \n    @param shareKey\n      The 'shareKey' identifier from the SharedNotebook that was granted to\n      some recipient.  This string internally encodes the notebook identifier\n      and a security signature.\n    \n    @param authenticationToken\n      If a non-empty string is provided, this is the full user-based\n      authentication token that identifies the user who is currently logged in\n      and trying to access the shared notebook.  This may be required if the\n      notebook was created with 'requireLogin'.\n      If this string is empty, the service will attempt to authenticate to the\n      shared notebook without any logged in user.\n    \n    @throws EDAMSystemException <ul>\n      <li> BAD_DATA_FORMAT \"shareKey\" - invalid shareKey string\n      </li>\n      <li> INVALID_AUTH \"shareKey\" - bad signature on shareKey string\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"SharedNotebook.id\" - the shared notebook no longer exists\n      </li>\n    </ul>\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"authenticationToken\" - the share requires login, and\n             no valid authentication token was provided.\n      </li>\n      <li> PERMISSION_DENIED \"SharedNotebook.username\" - share requires login,\n             and another username has already been bound to this notebook.\n      </li>\n    </ul>\n    \n    Parameters:\n     - shareKey\n     - authenticationToken\n    \"\"\"\n    self.send_authenticateToSharedNotebook(shareKey, authenticationToken)\n    return self.recv_authenticateToSharedNotebook()\n\n  def send_authenticateToSharedNotebook(self, shareKey, authenticationToken):\n    self._oprot.writeMessageBegin('authenticateToSharedNotebook', TMessageType.CALL, self._seqid)\n    args = authenticateToSharedNotebook_args()\n    args.shareKey = shareKey\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_authenticateToSharedNotebook(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = authenticateToSharedNotebook_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"authenticateToSharedNotebook failed: unknown result\");\n\n  def getSharedNotebookByAuth(self, authenticationToken):\n    \"\"\"\n    This function is used to retrieve extended information about a shared\n    notebook by a guest who has already authenticated to access that notebook.\n    This requires an 'authenticationToken' parameter which should be the\n    resut of a call to authenticateToSharedNotebook(...).\n    I.e. this is the token that gives access to the particular shared notebook\n    in someone else's account -- it's not the authenticationToken for the\n    owner of the notebook itself.\n    \n    @param authenticationToken\n      Should be the authentication token retrieved from the reply of\n      authenticateToSharedNotebook(), proving access to a particular shared\n      notebook.\n    \n    @throws EDAMUserException <ul>\n      <li> PERMISSION_DENIED \"authenticationToken\" -\n             authentication token doesn't correspond to a valid shared notebook\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"SharedNotebook.id\" - the shared notebook no longer exists\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_getSharedNotebookByAuth(authenticationToken)\n    return self.recv_getSharedNotebookByAuth()\n\n  def send_getSharedNotebookByAuth(self, authenticationToken):\n    self._oprot.writeMessageBegin('getSharedNotebookByAuth', TMessageType.CALL, self._seqid)\n    args = getSharedNotebookByAuth_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getSharedNotebookByAuth(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getSharedNotebookByAuth_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getSharedNotebookByAuth failed: unknown result\");\n\n  def emailNote(self, authenticationToken, parameters):\n    \"\"\"\n    Attempts to send a single note to one or more email recipients.\n    <p/>\n    NOTE: This function is generally not available to third party applications.\n    Calls will result in an EDAMUserException with the error code\n    PERMISSION_DENIED.\n    \n    @param authenticationToken\n       The note will be sent as the user logged in via this token, using that\n       user's registered email address.  If the authenticated user doesn't\n       have permission to read that note, the emailing will fail.\n    \n    @param parameters\n       The note must be specified either by GUID (in which case it will be\n       sent using the existing data in the service), or else the full Note\n       must be passed to this call.  This also specifies the additional\n       email fields that will be used in the email.\n    \n    @throws EDAMUserException <ul>\n      <li> LIMIT_REACHED \"NoteEmailParameters.toAddresses\" -\n        The email can't be sent because this would exceed the user's daily\n        email limit.\n      </li>\n      <li> BAD_DATA_FORMAT \"(email address)\" -\n        email address malformed\n      </li>\n      <li> DATA_REQUIRED \"NoteEmailParameters.toAddresses\" -\n        if there are no To: or Cc: addresses provided.\n      </li>\n      <li> DATA_REQUIRED \"Note.title\" -\n        if the caller provides a Note parameter with no title\n      </li>\n      <li> DATA_REQUIRED \"Note.content\" -\n        if the caller provides a Note parameter with no content\n      </li>\n      <li> ENML_VALIDATION \"*\" - note content doesn't validate against DTD\n      </li>\n      <li> DATA_REQUIRED \"NoteEmailParameters.note\" -\n        if no guid or note provided\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - parameters\n    \"\"\"\n    self.send_emailNote(authenticationToken, parameters)\n    self.recv_emailNote()\n\n  def send_emailNote(self, authenticationToken, parameters):\n    self._oprot.writeMessageBegin('emailNote', TMessageType.CALL, self._seqid)\n    args = emailNote_args()\n    args.authenticationToken = authenticationToken\n    args.parameters = parameters\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_emailNote(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = emailNote_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    return\n\n  def shareNote(self, authenticationToken, guid):\n    \"\"\"\n    If this note is not already shared (via its own direct URL), then this\n    will start sharing that note.\n    This will return the secret \"Note Key\" for this note that\n    can currently be used in conjunction with the Note's GUID to gain direct\n    read-only access to the Note.\n    If the note is already shared, then this won't make any changes to the\n    note, and the existing \"Note Key\" will be returned.  The only way to change\n    the Note Key for an existing note is to stopSharingNote first, and then\n    call this function.\n    \n    @param guid\n      The GUID of the note to be shared.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_shareNote(authenticationToken, guid)\n    return self.recv_shareNote()\n\n  def send_shareNote(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('shareNote', TMessageType.CALL, self._seqid)\n    args = shareNote_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_shareNote(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = shareNote_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"shareNote failed: unknown result\");\n\n  def stopSharingNote(self, authenticationToken, guid):\n    \"\"\"\n    If this note is not already shared then this will stop sharing that note\n    and invalidate its \"Note Key\", so any existing URLs to access that Note\n    will stop working.\n    If the Note is not shared, then this function will do nothing.\n    \n    @param guid\n      The GUID of the note to be un-shared.\n    \n    @throws EDAMUserException <ul>\n      <li> BAD_DATA_FORMAT \"Note.guid\" - if the parameter is missing\n      </li>\n      <li> PERMISSION_DENIED \"Note\" - private note, user doesn't own\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"Note.guid\" - not found, by GUID\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - guid\n    \"\"\"\n    self.send_stopSharingNote(authenticationToken, guid)\n    self.recv_stopSharingNote()\n\n  def send_stopSharingNote(self, authenticationToken, guid):\n    self._oprot.writeMessageBegin('stopSharingNote', TMessageType.CALL, self._seqid)\n    args = stopSharingNote_args()\n    args.authenticationToken = authenticationToken\n    args.guid = guid\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_stopSharingNote(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = stopSharingNote_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    return\n\n  def authenticateToSharedNote(self, guid, noteKey, authenticationToken):\n    \"\"\"\n    Asks the service to produce an authentication token that can be used to\n    access the contents of a single Note which was individually shared\n    from someone's account.\n    This authenticationToken can be used with the various other NoteStore\n    calls to find and retrieve the Note and its directly-referenced children.\n    \n    @param guid\n      The GUID identifying this Note on this shard.\n    \n    @param noteKey\n      The 'noteKey' identifier from the Note that was originally created via\n      a call to shareNote() and then given to a recipient to access.\n    \n    @param authenticationToken\n      An optional authenticationToken that identifies the user accessing the\n      shared note. This parameter may be required to access some shared notes.\n    \n    @throws EDAMUserException <ul>\n      <li> PERMISSION_DENIED \"Note\" - the Note with that GUID is either not\n        shared, or the noteKey doesn't match the current key for this note\n      </li>\n      <li> PERMISSION_DENIED \"authenticationToken\" - an authentication token is\n        required to access this Note, but either no authentication token or a\n        \"non-owner\" authentication token was provided.\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li> \"guid\" - the note with that GUID is not found\n      </li>\n    </ul>\n    \n    @throws EDAMSystemException <ul>\n      <li> TAKEN_DOWN \"Note\" - The specified shared note is taken down (for\n        all requesters).\n      </li>\n      <li> TAKEN_DOWN \"Country\" - The specified shared note is taken down\n        for the requester because of an IP-based country lookup.\n      </ul>\n    </ul>\n    \n    Parameters:\n     - guid\n     - noteKey\n     - authenticationToken\n    \"\"\"\n    self.send_authenticateToSharedNote(guid, noteKey, authenticationToken)\n    return self.recv_authenticateToSharedNote()\n\n  def send_authenticateToSharedNote(self, guid, noteKey, authenticationToken):\n    self._oprot.writeMessageBegin('authenticateToSharedNote', TMessageType.CALL, self._seqid)\n    args = authenticateToSharedNote_args()\n    args.guid = guid\n    args.noteKey = noteKey\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_authenticateToSharedNote(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = authenticateToSharedNote_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"authenticateToSharedNote failed: unknown result\");\n\n  def findRelated(self, authenticationToken, query, resultSpec):\n    \"\"\"\n    Identify related entities on the service, such as notes,\n    notebooks, and tags related to notes or content.\n    \n    @param query\n      The information about which we are finding related entities.\n    \n    @param resultSpec\n      Allows the client to indicate the type and quantity of\n      information to be returned, allowing a saving of time and\n      bandwidth.\n    \n    @return\n      The result of the query, with information considered\n      to likely be relevantly related to the information\n      described by the query.\n    \n    @throws EDAMUserException <ul>\n      <li>BAD_DATA_FORMAT \"RelatedQuery.plainText\" - If you provided a\n        a zero-length plain text value.\n      </li>\n      <li>BAD_DATA_FORMAT \"RelatedQuery.noteGuid\" - If you provided an\n        invalid Note GUID, that is, one that does not match the constraints\n        defined by EDAM_GUID_LEN_MIN, EDAM_GUID_LEN_MAX, EDAM_GUID_REGEX.\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.notebookGuid\" - if malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.tagGuids\" - if any are malformed\n      </li>\n      <li> BAD_DATA_FORMAT \"NoteFilter.words\" - if search string too long\n      </li>\n      <li>PERMISSION_DENIED \"Note\" - If the caller does not have access to\n        the note identified by RelatedQuery.noteGuid.\n      </li>\n      <li>DATA_REQUIRED \"RelatedResultSpec\" - If you did not not set any values\n        in the result spec.\n      </li>\n    </ul>\n    \n    @throws EDAMNotFoundException <ul>\n      <li>\"RelatedQuery.noteGuid\" - the note with that GUID is not\n        found, if that field has been set in the query.\n      </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - query\n     - resultSpec\n    \"\"\"\n    self.send_findRelated(authenticationToken, query, resultSpec)\n    return self.recv_findRelated()\n\n  def send_findRelated(self, authenticationToken, query, resultSpec):\n    self._oprot.writeMessageBegin('findRelated', TMessageType.CALL, self._seqid)\n    args = findRelated_args()\n    args.authenticationToken = authenticationToken\n    args.query = query\n    args.resultSpec = resultSpec\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_findRelated(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = findRelated_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"findRelated failed: unknown result\");\n\n\nclass Processor(Iface, TProcessor):\n  def __init__(self, handler):\n    self._handler = handler\n    self._processMap = {}\n    self._processMap[\"getSyncState\"] = Processor.process_getSyncState\n    self._processMap[\"getSyncStateWithMetrics\"] = Processor.process_getSyncStateWithMetrics\n    self._processMap[\"getSyncChunk\"] = Processor.process_getSyncChunk\n    self._processMap[\"getFilteredSyncChunk\"] = Processor.process_getFilteredSyncChunk\n    self._processMap[\"getLinkedNotebookSyncState\"] = Processor.process_getLinkedNotebookSyncState\n    self._processMap[\"getLinkedNotebookSyncChunk\"] = Processor.process_getLinkedNotebookSyncChunk\n    self._processMap[\"listNotebooks\"] = Processor.process_listNotebooks\n    self._processMap[\"getNotebook\"] = Processor.process_getNotebook\n    self._processMap[\"getDefaultNotebook\"] = Processor.process_getDefaultNotebook\n    self._processMap[\"createNotebook\"] = Processor.process_createNotebook\n    self._processMap[\"updateNotebook\"] = Processor.process_updateNotebook\n    self._processMap[\"expungeNotebook\"] = Processor.process_expungeNotebook\n    self._processMap[\"listTags\"] = Processor.process_listTags\n    self._processMap[\"listTagsByNotebook\"] = Processor.process_listTagsByNotebook\n    self._processMap[\"getTag\"] = Processor.process_getTag\n    self._processMap[\"createTag\"] = Processor.process_createTag\n    self._processMap[\"updateTag\"] = Processor.process_updateTag\n    self._processMap[\"untagAll\"] = Processor.process_untagAll\n    self._processMap[\"expungeTag\"] = Processor.process_expungeTag\n    self._processMap[\"listSearches\"] = Processor.process_listSearches\n    self._processMap[\"getSearch\"] = Processor.process_getSearch\n    self._processMap[\"createSearch\"] = Processor.process_createSearch\n    self._processMap[\"updateSearch\"] = Processor.process_updateSearch\n    self._processMap[\"expungeSearch\"] = Processor.process_expungeSearch\n    self._processMap[\"findNotes\"] = Processor.process_findNotes\n    self._processMap[\"findNoteOffset\"] = Processor.process_findNoteOffset\n    self._processMap[\"findNotesMetadata\"] = Processor.process_findNotesMetadata\n    self._processMap[\"findNoteCounts\"] = Processor.process_findNoteCounts\n    self._processMap[\"getNote\"] = Processor.process_getNote\n    self._processMap[\"getNoteApplicationData\"] = Processor.process_getNoteApplicationData\n    self._processMap[\"getNoteApplicationDataEntry\"] = Processor.process_getNoteApplicationDataEntry\n    self._processMap[\"setNoteApplicationDataEntry\"] = Processor.process_setNoteApplicationDataEntry\n    self._processMap[\"unsetNoteApplicationDataEntry\"] = Processor.process_unsetNoteApplicationDataEntry\n    self._processMap[\"getNoteContent\"] = Processor.process_getNoteContent\n    self._processMap[\"getNoteSearchText\"] = Processor.process_getNoteSearchText\n    self._processMap[\"getResourceSearchText\"] = Processor.process_getResourceSearchText\n    self._processMap[\"getNoteTagNames\"] = Processor.process_getNoteTagNames\n    self._processMap[\"createNote\"] = Processor.process_createNote\n    self._processMap[\"updateNote\"] = Processor.process_updateNote\n    self._processMap[\"deleteNote\"] = Processor.process_deleteNote\n    self._processMap[\"expungeNote\"] = Processor.process_expungeNote\n    self._processMap[\"expungeNotes\"] = Processor.process_expungeNotes\n    self._processMap[\"expungeInactiveNotes\"] = Processor.process_expungeInactiveNotes\n    self._processMap[\"copyNote\"] = Processor.process_copyNote\n    self._processMap[\"listNoteVersions\"] = Processor.process_listNoteVersions\n    self._processMap[\"getNoteVersion\"] = Processor.process_getNoteVersion\n    self._processMap[\"getResource\"] = Processor.process_getResource\n    self._processMap[\"getResourceApplicationData\"] = Processor.process_getResourceApplicationData\n    self._processMap[\"getResourceApplicationDataEntry\"] = Processor.process_getResourceApplicationDataEntry\n    self._processMap[\"setResourceApplicationDataEntry\"] = Processor.process_setResourceApplicationDataEntry\n    self._processMap[\"unsetResourceApplicationDataEntry\"] = Processor.process_unsetResourceApplicationDataEntry\n    self._processMap[\"updateResource\"] = Processor.process_updateResource\n    self._processMap[\"getResourceData\"] = Processor.process_getResourceData\n    self._processMap[\"getResourceByHash\"] = Processor.process_getResourceByHash\n    self._processMap[\"getResourceRecognition\"] = Processor.process_getResourceRecognition\n    self._processMap[\"getResourceAlternateData\"] = Processor.process_getResourceAlternateData\n    self._processMap[\"getResourceAttributes\"] = Processor.process_getResourceAttributes\n    self._processMap[\"getPublicNotebook\"] = Processor.process_getPublicNotebook\n    self._processMap[\"createSharedNotebook\"] = Processor.process_createSharedNotebook\n    self._processMap[\"updateSharedNotebook\"] = Processor.process_updateSharedNotebook\n    self._processMap[\"setSharedNotebookRecipientSettings\"] = Processor.process_setSharedNotebookRecipientSettings\n    self._processMap[\"sendMessageToSharedNotebookMembers\"] = Processor.process_sendMessageToSharedNotebookMembers\n    self._processMap[\"listSharedNotebooks\"] = Processor.process_listSharedNotebooks\n    self._processMap[\"expungeSharedNotebooks\"] = Processor.process_expungeSharedNotebooks\n    self._processMap[\"createLinkedNotebook\"] = Processor.process_createLinkedNotebook\n    self._processMap[\"updateLinkedNotebook\"] = Processor.process_updateLinkedNotebook\n    self._processMap[\"listLinkedNotebooks\"] = Processor.process_listLinkedNotebooks\n    self._processMap[\"expungeLinkedNotebook\"] = Processor.process_expungeLinkedNotebook\n    self._processMap[\"authenticateToSharedNotebook\"] = Processor.process_authenticateToSharedNotebook\n    self._processMap[\"getSharedNotebookByAuth\"] = Processor.process_getSharedNotebookByAuth\n    self._processMap[\"emailNote\"] = Processor.process_emailNote\n    self._processMap[\"shareNote\"] = Processor.process_shareNote\n    self._processMap[\"stopSharingNote\"] = Processor.process_stopSharingNote\n    self._processMap[\"authenticateToSharedNote\"] = Processor.process_authenticateToSharedNote\n    self._processMap[\"findRelated\"] = Processor.process_findRelated\n\n  def process(self, iprot, oprot):\n    (name, type, seqid) = iprot.readMessageBegin()\n    if name not in self._processMap:\n      iprot.skip(TType.STRUCT)\n      iprot.readMessageEnd()\n      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))\n      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)\n      x.write(oprot)\n      oprot.writeMessageEnd()\n      oprot.trans.flush()\n      return\n    else:\n      self._processMap[name](self, seqid, iprot, oprot)\n    return True\n\n  def process_getSyncState(self, seqid, iprot, oprot):\n    args = getSyncState_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getSyncState_result()\n    try:\n      result.success = self._handler.getSyncState(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"getSyncState\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getSyncStateWithMetrics(self, seqid, iprot, oprot):\n    args = getSyncStateWithMetrics_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getSyncStateWithMetrics_result()\n    try:\n      result.success = self._handler.getSyncStateWithMetrics(args.authenticationToken, args.clientMetrics)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"getSyncStateWithMetrics\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getSyncChunk(self, seqid, iprot, oprot):\n    args = getSyncChunk_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getSyncChunk_result()\n    try:\n      result.success = self._handler.getSyncChunk(args.authenticationToken, args.afterUSN, args.maxEntries, args.fullSyncOnly)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"getSyncChunk\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getFilteredSyncChunk(self, seqid, iprot, oprot):\n    args = getFilteredSyncChunk_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getFilteredSyncChunk_result()\n    try:\n      result.success = self._handler.getFilteredSyncChunk(args.authenticationToken, args.afterUSN, args.maxEntries, args.filter)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"getFilteredSyncChunk\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getLinkedNotebookSyncState(self, seqid, iprot, oprot):\n    args = getLinkedNotebookSyncState_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getLinkedNotebookSyncState_result()\n    try:\n      result.success = self._handler.getLinkedNotebookSyncState(args.authenticationToken, args.linkedNotebook)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getLinkedNotebookSyncState\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getLinkedNotebookSyncChunk(self, seqid, iprot, oprot):\n    args = getLinkedNotebookSyncChunk_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getLinkedNotebookSyncChunk_result()\n    try:\n      result.success = self._handler.getLinkedNotebookSyncChunk(args.authenticationToken, args.linkedNotebook, args.afterUSN, args.maxEntries, args.fullSyncOnly)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getLinkedNotebookSyncChunk\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_listNotebooks(self, seqid, iprot, oprot):\n    args = listNotebooks_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = listNotebooks_result()\n    try:\n      result.success = self._handler.listNotebooks(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"listNotebooks\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getNotebook(self, seqid, iprot, oprot):\n    args = getNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getNotebook_result()\n    try:\n      result.success = self._handler.getNotebook(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getDefaultNotebook(self, seqid, iprot, oprot):\n    args = getDefaultNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getDefaultNotebook_result()\n    try:\n      result.success = self._handler.getDefaultNotebook(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"getDefaultNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_createNotebook(self, seqid, iprot, oprot):\n    args = createNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = createNotebook_result()\n    try:\n      result.success = self._handler.createNotebook(args.authenticationToken, args.notebook)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"createNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_updateNotebook(self, seqid, iprot, oprot):\n    args = updateNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = updateNotebook_result()\n    try:\n      result.success = self._handler.updateNotebook(args.authenticationToken, args.notebook)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"updateNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_expungeNotebook(self, seqid, iprot, oprot):\n    args = expungeNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = expungeNotebook_result()\n    try:\n      result.success = self._handler.expungeNotebook(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"expungeNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_listTags(self, seqid, iprot, oprot):\n    args = listTags_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = listTags_result()\n    try:\n      result.success = self._handler.listTags(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"listTags\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_listTagsByNotebook(self, seqid, iprot, oprot):\n    args = listTagsByNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = listTagsByNotebook_result()\n    try:\n      result.success = self._handler.listTagsByNotebook(args.authenticationToken, args.notebookGuid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"listTagsByNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getTag(self, seqid, iprot, oprot):\n    args = getTag_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getTag_result()\n    try:\n      result.success = self._handler.getTag(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getTag\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_createTag(self, seqid, iprot, oprot):\n    args = createTag_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = createTag_result()\n    try:\n      result.success = self._handler.createTag(args.authenticationToken, args.tag)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"createTag\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_updateTag(self, seqid, iprot, oprot):\n    args = updateTag_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = updateTag_result()\n    try:\n      result.success = self._handler.updateTag(args.authenticationToken, args.tag)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"updateTag\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_untagAll(self, seqid, iprot, oprot):\n    args = untagAll_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = untagAll_result()\n    try:\n      self._handler.untagAll(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"untagAll\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_expungeTag(self, seqid, iprot, oprot):\n    args = expungeTag_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = expungeTag_result()\n    try:\n      result.success = self._handler.expungeTag(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"expungeTag\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_listSearches(self, seqid, iprot, oprot):\n    args = listSearches_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = listSearches_result()\n    try:\n      result.success = self._handler.listSearches(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"listSearches\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getSearch(self, seqid, iprot, oprot):\n    args = getSearch_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getSearch_result()\n    try:\n      result.success = self._handler.getSearch(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getSearch\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_createSearch(self, seqid, iprot, oprot):\n    args = createSearch_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = createSearch_result()\n    try:\n      result.success = self._handler.createSearch(args.authenticationToken, args.search)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"createSearch\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_updateSearch(self, seqid, iprot, oprot):\n    args = updateSearch_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = updateSearch_result()\n    try:\n      result.success = self._handler.updateSearch(args.authenticationToken, args.search)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"updateSearch\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_expungeSearch(self, seqid, iprot, oprot):\n    args = expungeSearch_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = expungeSearch_result()\n    try:\n      result.success = self._handler.expungeSearch(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"expungeSearch\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_findNotes(self, seqid, iprot, oprot):\n    args = findNotes_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = findNotes_result()\n    try:\n      result.success = self._handler.findNotes(args.authenticationToken, args.filter, args.offset, args.maxNotes)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"findNotes\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_findNoteOffset(self, seqid, iprot, oprot):\n    args = findNoteOffset_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = findNoteOffset_result()\n    try:\n      result.success = self._handler.findNoteOffset(args.authenticationToken, args.filter, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"findNoteOffset\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_findNotesMetadata(self, seqid, iprot, oprot):\n    args = findNotesMetadata_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = findNotesMetadata_result()\n    try:\n      result.success = self._handler.findNotesMetadata(args.authenticationToken, args.filter, args.offset, args.maxNotes, args.resultSpec)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"findNotesMetadata\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_findNoteCounts(self, seqid, iprot, oprot):\n    args = findNoteCounts_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = findNoteCounts_result()\n    try:\n      result.success = self._handler.findNoteCounts(args.authenticationToken, args.filter, args.withTrash)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"findNoteCounts\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getNote(self, seqid, iprot, oprot):\n    args = getNote_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getNote_result()\n    try:\n      result.success = self._handler.getNote(args.authenticationToken, args.guid, args.withContent, args.withResourcesData, args.withResourcesRecognition, args.withResourcesAlternateData)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getNote\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getNoteApplicationData(self, seqid, iprot, oprot):\n    args = getNoteApplicationData_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getNoteApplicationData_result()\n    try:\n      result.success = self._handler.getNoteApplicationData(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getNoteApplicationData\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getNoteApplicationDataEntry(self, seqid, iprot, oprot):\n    args = getNoteApplicationDataEntry_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getNoteApplicationDataEntry_result()\n    try:\n      result.success = self._handler.getNoteApplicationDataEntry(args.authenticationToken, args.guid, args.key)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getNoteApplicationDataEntry\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_setNoteApplicationDataEntry(self, seqid, iprot, oprot):\n    args = setNoteApplicationDataEntry_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = setNoteApplicationDataEntry_result()\n    try:\n      result.success = self._handler.setNoteApplicationDataEntry(args.authenticationToken, args.guid, args.key, args.value)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"setNoteApplicationDataEntry\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_unsetNoteApplicationDataEntry(self, seqid, iprot, oprot):\n    args = unsetNoteApplicationDataEntry_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = unsetNoteApplicationDataEntry_result()\n    try:\n      result.success = self._handler.unsetNoteApplicationDataEntry(args.authenticationToken, args.guid, args.key)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"unsetNoteApplicationDataEntry\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getNoteContent(self, seqid, iprot, oprot):\n    args = getNoteContent_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getNoteContent_result()\n    try:\n      result.success = self._handler.getNoteContent(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getNoteContent\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getNoteSearchText(self, seqid, iprot, oprot):\n    args = getNoteSearchText_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getNoteSearchText_result()\n    try:\n      result.success = self._handler.getNoteSearchText(args.authenticationToken, args.guid, args.noteOnly, args.tokenizeForIndexing)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getNoteSearchText\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getResourceSearchText(self, seqid, iprot, oprot):\n    args = getResourceSearchText_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getResourceSearchText_result()\n    try:\n      result.success = self._handler.getResourceSearchText(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getResourceSearchText\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getNoteTagNames(self, seqid, iprot, oprot):\n    args = getNoteTagNames_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getNoteTagNames_result()\n    try:\n      result.success = self._handler.getNoteTagNames(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getNoteTagNames\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_createNote(self, seqid, iprot, oprot):\n    args = createNote_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = createNote_result()\n    try:\n      result.success = self._handler.createNote(args.authenticationToken, args.note)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"createNote\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_updateNote(self, seqid, iprot, oprot):\n    args = updateNote_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = updateNote_result()\n    try:\n      result.success = self._handler.updateNote(args.authenticationToken, args.note)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"updateNote\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_deleteNote(self, seqid, iprot, oprot):\n    args = deleteNote_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = deleteNote_result()\n    try:\n      result.success = self._handler.deleteNote(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"deleteNote\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_expungeNote(self, seqid, iprot, oprot):\n    args = expungeNote_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = expungeNote_result()\n    try:\n      result.success = self._handler.expungeNote(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"expungeNote\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_expungeNotes(self, seqid, iprot, oprot):\n    args = expungeNotes_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = expungeNotes_result()\n    try:\n      result.success = self._handler.expungeNotes(args.authenticationToken, args.noteGuids)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"expungeNotes\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_expungeInactiveNotes(self, seqid, iprot, oprot):\n    args = expungeInactiveNotes_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = expungeInactiveNotes_result()\n    try:\n      result.success = self._handler.expungeInactiveNotes(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"expungeInactiveNotes\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_copyNote(self, seqid, iprot, oprot):\n    args = copyNote_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = copyNote_result()\n    try:\n      result.success = self._handler.copyNote(args.authenticationToken, args.noteGuid, args.toNotebookGuid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"copyNote\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_listNoteVersions(self, seqid, iprot, oprot):\n    args = listNoteVersions_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = listNoteVersions_result()\n    try:\n      result.success = self._handler.listNoteVersions(args.authenticationToken, args.noteGuid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"listNoteVersions\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getNoteVersion(self, seqid, iprot, oprot):\n    args = getNoteVersion_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getNoteVersion_result()\n    try:\n      result.success = self._handler.getNoteVersion(args.authenticationToken, args.noteGuid, args.updateSequenceNum, args.withResourcesData, args.withResourcesRecognition, args.withResourcesAlternateData)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getNoteVersion\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getResource(self, seqid, iprot, oprot):\n    args = getResource_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getResource_result()\n    try:\n      result.success = self._handler.getResource(args.authenticationToken, args.guid, args.withData, args.withRecognition, args.withAttributes, args.withAlternateData)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getResource\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getResourceApplicationData(self, seqid, iprot, oprot):\n    args = getResourceApplicationData_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getResourceApplicationData_result()\n    try:\n      result.success = self._handler.getResourceApplicationData(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getResourceApplicationData\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getResourceApplicationDataEntry(self, seqid, iprot, oprot):\n    args = getResourceApplicationDataEntry_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getResourceApplicationDataEntry_result()\n    try:\n      result.success = self._handler.getResourceApplicationDataEntry(args.authenticationToken, args.guid, args.key)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getResourceApplicationDataEntry\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_setResourceApplicationDataEntry(self, seqid, iprot, oprot):\n    args = setResourceApplicationDataEntry_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = setResourceApplicationDataEntry_result()\n    try:\n      result.success = self._handler.setResourceApplicationDataEntry(args.authenticationToken, args.guid, args.key, args.value)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"setResourceApplicationDataEntry\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_unsetResourceApplicationDataEntry(self, seqid, iprot, oprot):\n    args = unsetResourceApplicationDataEntry_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = unsetResourceApplicationDataEntry_result()\n    try:\n      result.success = self._handler.unsetResourceApplicationDataEntry(args.authenticationToken, args.guid, args.key)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"unsetResourceApplicationDataEntry\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_updateResource(self, seqid, iprot, oprot):\n    args = updateResource_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = updateResource_result()\n    try:\n      result.success = self._handler.updateResource(args.authenticationToken, args.resource)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"updateResource\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getResourceData(self, seqid, iprot, oprot):\n    args = getResourceData_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getResourceData_result()\n    try:\n      result.success = self._handler.getResourceData(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getResourceData\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getResourceByHash(self, seqid, iprot, oprot):\n    args = getResourceByHash_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getResourceByHash_result()\n    try:\n      result.success = self._handler.getResourceByHash(args.authenticationToken, args.noteGuid, args.contentHash, args.withData, args.withRecognition, args.withAlternateData)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getResourceByHash\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getResourceRecognition(self, seqid, iprot, oprot):\n    args = getResourceRecognition_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getResourceRecognition_result()\n    try:\n      result.success = self._handler.getResourceRecognition(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getResourceRecognition\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getResourceAlternateData(self, seqid, iprot, oprot):\n    args = getResourceAlternateData_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getResourceAlternateData_result()\n    try:\n      result.success = self._handler.getResourceAlternateData(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getResourceAlternateData\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getResourceAttributes(self, seqid, iprot, oprot):\n    args = getResourceAttributes_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getResourceAttributes_result()\n    try:\n      result.success = self._handler.getResourceAttributes(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getResourceAttributes\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getPublicNotebook(self, seqid, iprot, oprot):\n    args = getPublicNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getPublicNotebook_result()\n    try:\n      result.success = self._handler.getPublicNotebook(args.userId, args.publicUri)\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"getPublicNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_createSharedNotebook(self, seqid, iprot, oprot):\n    args = createSharedNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = createSharedNotebook_result()\n    try:\n      result.success = self._handler.createSharedNotebook(args.authenticationToken, args.sharedNotebook)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"createSharedNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_updateSharedNotebook(self, seqid, iprot, oprot):\n    args = updateSharedNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = updateSharedNotebook_result()\n    try:\n      result.success = self._handler.updateSharedNotebook(args.authenticationToken, args.sharedNotebook)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"updateSharedNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_setSharedNotebookRecipientSettings(self, seqid, iprot, oprot):\n    args = setSharedNotebookRecipientSettings_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = setSharedNotebookRecipientSettings_result()\n    try:\n      result.success = self._handler.setSharedNotebookRecipientSettings(args.authenticationToken, args.sharedNotebookId, args.recipientSettings)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"setSharedNotebookRecipientSettings\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_sendMessageToSharedNotebookMembers(self, seqid, iprot, oprot):\n    args = sendMessageToSharedNotebookMembers_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = sendMessageToSharedNotebookMembers_result()\n    try:\n      result.success = self._handler.sendMessageToSharedNotebookMembers(args.authenticationToken, args.notebookGuid, args.messageText, args.recipients)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"sendMessageToSharedNotebookMembers\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_listSharedNotebooks(self, seqid, iprot, oprot):\n    args = listSharedNotebooks_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = listSharedNotebooks_result()\n    try:\n      result.success = self._handler.listSharedNotebooks(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"listSharedNotebooks\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_expungeSharedNotebooks(self, seqid, iprot, oprot):\n    args = expungeSharedNotebooks_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = expungeSharedNotebooks_result()\n    try:\n      result.success = self._handler.expungeSharedNotebooks(args.authenticationToken, args.sharedNotebookIds)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"expungeSharedNotebooks\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_createLinkedNotebook(self, seqid, iprot, oprot):\n    args = createLinkedNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = createLinkedNotebook_result()\n    try:\n      result.success = self._handler.createLinkedNotebook(args.authenticationToken, args.linkedNotebook)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"createLinkedNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_updateLinkedNotebook(self, seqid, iprot, oprot):\n    args = updateLinkedNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = updateLinkedNotebook_result()\n    try:\n      result.success = self._handler.updateLinkedNotebook(args.authenticationToken, args.linkedNotebook)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"updateLinkedNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_listLinkedNotebooks(self, seqid, iprot, oprot):\n    args = listLinkedNotebooks_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = listLinkedNotebooks_result()\n    try:\n      result.success = self._handler.listLinkedNotebooks(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"listLinkedNotebooks\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_expungeLinkedNotebook(self, seqid, iprot, oprot):\n    args = expungeLinkedNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = expungeLinkedNotebook_result()\n    try:\n      result.success = self._handler.expungeLinkedNotebook(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"expungeLinkedNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_authenticateToSharedNotebook(self, seqid, iprot, oprot):\n    args = authenticateToSharedNotebook_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = authenticateToSharedNotebook_result()\n    try:\n      result.success = self._handler.authenticateToSharedNotebook(args.shareKey, args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"authenticateToSharedNotebook\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getSharedNotebookByAuth(self, seqid, iprot, oprot):\n    args = getSharedNotebookByAuth_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getSharedNotebookByAuth_result()\n    try:\n      result.success = self._handler.getSharedNotebookByAuth(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"getSharedNotebookByAuth\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_emailNote(self, seqid, iprot, oprot):\n    args = emailNote_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = emailNote_result()\n    try:\n      self._handler.emailNote(args.authenticationToken, args.parameters)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"emailNote\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_shareNote(self, seqid, iprot, oprot):\n    args = shareNote_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = shareNote_result()\n    try:\n      result.success = self._handler.shareNote(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"shareNote\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_stopSharingNote(self, seqid, iprot, oprot):\n    args = stopSharingNote_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = stopSharingNote_result()\n    try:\n      self._handler.stopSharingNote(args.authenticationToken, args.guid)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"stopSharingNote\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_authenticateToSharedNote(self, seqid, iprot, oprot):\n    args = authenticateToSharedNote_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = authenticateToSharedNote_result()\n    try:\n      result.success = self._handler.authenticateToSharedNote(args.guid, args.noteKey, args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"authenticateToSharedNote\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_findRelated(self, seqid, iprot, oprot):\n    args = findRelated_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = findRelated_result()\n    try:\n      result.success = self._handler.findRelated(args.authenticationToken, args.query, args.resultSpec)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    oprot.writeMessageBegin(\"findRelated\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n\n# HELPER FUNCTIONS AND STRUCTURES\n\nclass getSyncState_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getSyncState_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getSyncState_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (SyncState, SyncState.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = SyncState()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getSyncState_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getSyncStateWithMetrics_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - clientMetrics\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'clientMetrics', (ClientUsageMetrics, ClientUsageMetrics.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, clientMetrics=None,):\n    self.authenticationToken = authenticationToken\n    self.clientMetrics = clientMetrics\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.clientMetrics = ClientUsageMetrics()\n          self.clientMetrics.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getSyncStateWithMetrics_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.clientMetrics is not None:\n      oprot.writeFieldBegin('clientMetrics', TType.STRUCT, 2)\n      self.clientMetrics.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getSyncStateWithMetrics_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (SyncState, SyncState.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = SyncState()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getSyncStateWithMetrics_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getSyncChunk_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - afterUSN\n   - maxEntries\n   - fullSyncOnly\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.I32, 'afterUSN', None, None, ), # 2\n    (3, TType.I32, 'maxEntries', None, None, ), # 3\n    (4, TType.BOOL, 'fullSyncOnly', None, None, ), # 4\n  )\n\n  def __init__(self, authenticationToken=None, afterUSN=None, maxEntries=None, fullSyncOnly=None,):\n    self.authenticationToken = authenticationToken\n    self.afterUSN = afterUSN\n    self.maxEntries = maxEntries\n    self.fullSyncOnly = fullSyncOnly\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I32:\n          self.afterUSN = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.maxEntries = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.BOOL:\n          self.fullSyncOnly = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getSyncChunk_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.afterUSN is not None:\n      oprot.writeFieldBegin('afterUSN', TType.I32, 2)\n      oprot.writeI32(self.afterUSN)\n      oprot.writeFieldEnd()\n    if self.maxEntries is not None:\n      oprot.writeFieldBegin('maxEntries', TType.I32, 3)\n      oprot.writeI32(self.maxEntries)\n      oprot.writeFieldEnd()\n    if self.fullSyncOnly is not None:\n      oprot.writeFieldBegin('fullSyncOnly', TType.BOOL, 4)\n      oprot.writeBool(self.fullSyncOnly)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getSyncChunk_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (SyncChunk, SyncChunk.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = SyncChunk()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getSyncChunk_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getFilteredSyncChunk_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - afterUSN\n   - maxEntries\n   - filter\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.I32, 'afterUSN', None, None, ), # 2\n    (3, TType.I32, 'maxEntries', None, None, ), # 3\n    (4, TType.STRUCT, 'filter', (SyncChunkFilter, SyncChunkFilter.thrift_spec), None, ), # 4\n  )\n\n  def __init__(self, authenticationToken=None, afterUSN=None, maxEntries=None, filter=None,):\n    self.authenticationToken = authenticationToken\n    self.afterUSN = afterUSN\n    self.maxEntries = maxEntries\n    self.filter = filter\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I32:\n          self.afterUSN = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.maxEntries = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRUCT:\n          self.filter = SyncChunkFilter()\n          self.filter.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getFilteredSyncChunk_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.afterUSN is not None:\n      oprot.writeFieldBegin('afterUSN', TType.I32, 2)\n      oprot.writeI32(self.afterUSN)\n      oprot.writeFieldEnd()\n    if self.maxEntries is not None:\n      oprot.writeFieldBegin('maxEntries', TType.I32, 3)\n      oprot.writeI32(self.maxEntries)\n      oprot.writeFieldEnd()\n    if self.filter is not None:\n      oprot.writeFieldBegin('filter', TType.STRUCT, 4)\n      self.filter.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getFilteredSyncChunk_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (SyncChunk, SyncChunk.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = SyncChunk()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getFilteredSyncChunk_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getLinkedNotebookSyncState_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - linkedNotebook\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'linkedNotebook', (evernote.edam.type.ttypes.LinkedNotebook, evernote.edam.type.ttypes.LinkedNotebook.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, linkedNotebook=None,):\n    self.authenticationToken = authenticationToken\n    self.linkedNotebook = linkedNotebook\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.linkedNotebook = evernote.edam.type.ttypes.LinkedNotebook()\n          self.linkedNotebook.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getLinkedNotebookSyncState_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.linkedNotebook is not None:\n      oprot.writeFieldBegin('linkedNotebook', TType.STRUCT, 2)\n      self.linkedNotebook.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getLinkedNotebookSyncState_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (SyncState, SyncState.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = SyncState()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getLinkedNotebookSyncState_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getLinkedNotebookSyncChunk_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - linkedNotebook\n   - afterUSN\n   - maxEntries\n   - fullSyncOnly\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'linkedNotebook', (evernote.edam.type.ttypes.LinkedNotebook, evernote.edam.type.ttypes.LinkedNotebook.thrift_spec), None, ), # 2\n    (3, TType.I32, 'afterUSN', None, None, ), # 3\n    (4, TType.I32, 'maxEntries', None, None, ), # 4\n    (5, TType.BOOL, 'fullSyncOnly', None, None, ), # 5\n  )\n\n  def __init__(self, authenticationToken=None, linkedNotebook=None, afterUSN=None, maxEntries=None, fullSyncOnly=None,):\n    self.authenticationToken = authenticationToken\n    self.linkedNotebook = linkedNotebook\n    self.afterUSN = afterUSN\n    self.maxEntries = maxEntries\n    self.fullSyncOnly = fullSyncOnly\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.linkedNotebook = evernote.edam.type.ttypes.LinkedNotebook()\n          self.linkedNotebook.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.afterUSN = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.I32:\n          self.maxEntries = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.fullSyncOnly = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getLinkedNotebookSyncChunk_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.linkedNotebook is not None:\n      oprot.writeFieldBegin('linkedNotebook', TType.STRUCT, 2)\n      self.linkedNotebook.write(oprot)\n      oprot.writeFieldEnd()\n    if self.afterUSN is not None:\n      oprot.writeFieldBegin('afterUSN', TType.I32, 3)\n      oprot.writeI32(self.afterUSN)\n      oprot.writeFieldEnd()\n    if self.maxEntries is not None:\n      oprot.writeFieldBegin('maxEntries', TType.I32, 4)\n      oprot.writeI32(self.maxEntries)\n      oprot.writeFieldEnd()\n    if self.fullSyncOnly is not None:\n      oprot.writeFieldBegin('fullSyncOnly', TType.BOOL, 5)\n      oprot.writeBool(self.fullSyncOnly)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getLinkedNotebookSyncChunk_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (SyncChunk, SyncChunk.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = SyncChunk()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getLinkedNotebookSyncChunk_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listNotebooks_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listNotebooks_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listNotebooks_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.LIST, 'success', (TType.STRUCT,(evernote.edam.type.ttypes.Notebook, evernote.edam.type.ttypes.Notebook.thrift_spec)), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.LIST:\n          self.success = []\n          (_etype196, _size193) = iprot.readListBegin()\n          for _i197 in xrange(_size193):\n            _elem198 = evernote.edam.type.ttypes.Notebook()\n            _elem198.read(iprot)\n            self.success.append(_elem198)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listNotebooks_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.LIST, 0)\n      oprot.writeListBegin(TType.STRUCT, len(self.success))\n      for iter199 in self.success:\n        iter199.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNotebook_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Notebook, evernote.edam.type.ttypes.Notebook.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Notebook()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getDefaultNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getDefaultNotebook_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getDefaultNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Notebook, evernote.edam.type.ttypes.Notebook.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Notebook()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getDefaultNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass createNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - notebook\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'notebook', (evernote.edam.type.ttypes.Notebook, evernote.edam.type.ttypes.Notebook.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, notebook=None,):\n    self.authenticationToken = authenticationToken\n    self.notebook = notebook\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notebook = evernote.edam.type.ttypes.Notebook()\n          self.notebook.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('createNotebook_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.notebook is not None:\n      oprot.writeFieldBegin('notebook', TType.STRUCT, 2)\n      self.notebook.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass createNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Notebook, evernote.edam.type.ttypes.Notebook.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Notebook()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('createNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - notebook\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'notebook', (evernote.edam.type.ttypes.Notebook, evernote.edam.type.ttypes.Notebook.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, notebook=None,):\n    self.authenticationToken = authenticationToken\n    self.notebook = notebook\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notebook = evernote.edam.type.ttypes.Notebook()\n          self.notebook.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateNotebook_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.notebook is not None:\n      oprot.writeFieldBegin('notebook', TType.STRUCT, 2)\n      self.notebook.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeNotebook_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listTags_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listTags_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listTags_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.LIST, 'success', (TType.STRUCT,(evernote.edam.type.ttypes.Tag, evernote.edam.type.ttypes.Tag.thrift_spec)), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.LIST:\n          self.success = []\n          (_etype203, _size200) = iprot.readListBegin()\n          for _i204 in xrange(_size200):\n            _elem205 = evernote.edam.type.ttypes.Tag()\n            _elem205.read(iprot)\n            self.success.append(_elem205)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listTags_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.LIST, 0)\n      oprot.writeListBegin(TType.STRUCT, len(self.success))\n      for iter206 in self.success:\n        iter206.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listTagsByNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - notebookGuid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'notebookGuid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, notebookGuid=None,):\n    self.authenticationToken = authenticationToken\n    self.notebookGuid = notebookGuid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.notebookGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listTagsByNotebook_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.notebookGuid is not None:\n      oprot.writeFieldBegin('notebookGuid', TType.STRING, 2)\n      oprot.writeString(self.notebookGuid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listTagsByNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.LIST, 'success', (TType.STRUCT,(evernote.edam.type.ttypes.Tag, evernote.edam.type.ttypes.Tag.thrift_spec)), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.LIST:\n          self.success = []\n          (_etype210, _size207) = iprot.readListBegin()\n          for _i211 in xrange(_size207):\n            _elem212 = evernote.edam.type.ttypes.Tag()\n            _elem212.read(iprot)\n            self.success.append(_elem212)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listTagsByNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.LIST, 0)\n      oprot.writeListBegin(TType.STRUCT, len(self.success))\n      for iter213 in self.success:\n        iter213.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getTag_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getTag_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getTag_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Tag, evernote.edam.type.ttypes.Tag.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Tag()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getTag_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass createTag_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - tag\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'tag', (evernote.edam.type.ttypes.Tag, evernote.edam.type.ttypes.Tag.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, tag=None,):\n    self.authenticationToken = authenticationToken\n    self.tag = tag\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.tag = evernote.edam.type.ttypes.Tag()\n          self.tag.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('createTag_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.tag is not None:\n      oprot.writeFieldBegin('tag', TType.STRUCT, 2)\n      self.tag.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass createTag_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Tag, evernote.edam.type.ttypes.Tag.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Tag()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('createTag_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateTag_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - tag\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'tag', (evernote.edam.type.ttypes.Tag, evernote.edam.type.ttypes.Tag.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, tag=None,):\n    self.authenticationToken = authenticationToken\n    self.tag = tag\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.tag = evernote.edam.type.ttypes.Tag()\n          self.tag.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateTag_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.tag is not None:\n      oprot.writeFieldBegin('tag', TType.STRUCT, 2)\n      self.tag.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateTag_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateTag_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass untagAll_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('untagAll_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass untagAll_result(object):\n  \"\"\"\n  Attributes:\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, userException=None, systemException=None, notFoundException=None,):\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('untagAll_result')\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeTag_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeTag_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeTag_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeTag_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listSearches_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listSearches_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listSearches_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.LIST, 'success', (TType.STRUCT,(evernote.edam.type.ttypes.SavedSearch, evernote.edam.type.ttypes.SavedSearch.thrift_spec)), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.LIST:\n          self.success = []\n          (_etype217, _size214) = iprot.readListBegin()\n          for _i218 in xrange(_size214):\n            _elem219 = evernote.edam.type.ttypes.SavedSearch()\n            _elem219.read(iprot)\n            self.success.append(_elem219)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listSearches_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.LIST, 0)\n      oprot.writeListBegin(TType.STRUCT, len(self.success))\n      for iter220 in self.success:\n        iter220.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getSearch_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getSearch_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getSearch_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.SavedSearch, evernote.edam.type.ttypes.SavedSearch.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.SavedSearch()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getSearch_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass createSearch_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - search\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'search', (evernote.edam.type.ttypes.SavedSearch, evernote.edam.type.ttypes.SavedSearch.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, search=None,):\n    self.authenticationToken = authenticationToken\n    self.search = search\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.search = evernote.edam.type.ttypes.SavedSearch()\n          self.search.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('createSearch_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.search is not None:\n      oprot.writeFieldBegin('search', TType.STRUCT, 2)\n      self.search.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass createSearch_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.SavedSearch, evernote.edam.type.ttypes.SavedSearch.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.SavedSearch()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('createSearch_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateSearch_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - search\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'search', (evernote.edam.type.ttypes.SavedSearch, evernote.edam.type.ttypes.SavedSearch.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, search=None,):\n    self.authenticationToken = authenticationToken\n    self.search = search\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.search = evernote.edam.type.ttypes.SavedSearch()\n          self.search.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateSearch_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.search is not None:\n      oprot.writeFieldBegin('search', TType.STRUCT, 2)\n      self.search.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateSearch_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateSearch_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeSearch_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeSearch_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeSearch_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeSearch_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass findNotes_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - filter\n   - offset\n   - maxNotes\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'filter', (NoteFilter, NoteFilter.thrift_spec), None, ), # 2\n    (3, TType.I32, 'offset', None, None, ), # 3\n    (4, TType.I32, 'maxNotes', None, None, ), # 4\n  )\n\n  def __init__(self, authenticationToken=None, filter=None, offset=None, maxNotes=None,):\n    self.authenticationToken = authenticationToken\n    self.filter = filter\n    self.offset = offset\n    self.maxNotes = maxNotes\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.filter = NoteFilter()\n          self.filter.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.offset = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.I32:\n          self.maxNotes = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('findNotes_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.filter is not None:\n      oprot.writeFieldBegin('filter', TType.STRUCT, 2)\n      self.filter.write(oprot)\n      oprot.writeFieldEnd()\n    if self.offset is not None:\n      oprot.writeFieldBegin('offset', TType.I32, 3)\n      oprot.writeI32(self.offset)\n      oprot.writeFieldEnd()\n    if self.maxNotes is not None:\n      oprot.writeFieldBegin('maxNotes', TType.I32, 4)\n      oprot.writeI32(self.maxNotes)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass findNotes_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (NoteList, NoteList.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = NoteList()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('findNotes_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass findNoteOffset_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - filter\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'filter', (NoteFilter, NoteFilter.thrift_spec), None, ), # 2\n    (3, TType.STRING, 'guid', None, None, ), # 3\n  )\n\n  def __init__(self, authenticationToken=None, filter=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.filter = filter\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.filter = NoteFilter()\n          self.filter.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('findNoteOffset_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.filter is not None:\n      oprot.writeFieldBegin('filter', TType.STRUCT, 2)\n      self.filter.write(oprot)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 3)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass findNoteOffset_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('findNoteOffset_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass findNotesMetadata_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - filter\n   - offset\n   - maxNotes\n   - resultSpec\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'filter', (NoteFilter, NoteFilter.thrift_spec), None, ), # 2\n    (3, TType.I32, 'offset', None, None, ), # 3\n    (4, TType.I32, 'maxNotes', None, None, ), # 4\n    (5, TType.STRUCT, 'resultSpec', (NotesMetadataResultSpec, NotesMetadataResultSpec.thrift_spec), None, ), # 5\n  )\n\n  def __init__(self, authenticationToken=None, filter=None, offset=None, maxNotes=None, resultSpec=None,):\n    self.authenticationToken = authenticationToken\n    self.filter = filter\n    self.offset = offset\n    self.maxNotes = maxNotes\n    self.resultSpec = resultSpec\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.filter = NoteFilter()\n          self.filter.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.offset = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.I32:\n          self.maxNotes = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.STRUCT:\n          self.resultSpec = NotesMetadataResultSpec()\n          self.resultSpec.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('findNotesMetadata_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.filter is not None:\n      oprot.writeFieldBegin('filter', TType.STRUCT, 2)\n      self.filter.write(oprot)\n      oprot.writeFieldEnd()\n    if self.offset is not None:\n      oprot.writeFieldBegin('offset', TType.I32, 3)\n      oprot.writeI32(self.offset)\n      oprot.writeFieldEnd()\n    if self.maxNotes is not None:\n      oprot.writeFieldBegin('maxNotes', TType.I32, 4)\n      oprot.writeI32(self.maxNotes)\n      oprot.writeFieldEnd()\n    if self.resultSpec is not None:\n      oprot.writeFieldBegin('resultSpec', TType.STRUCT, 5)\n      self.resultSpec.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass findNotesMetadata_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (NotesMetadataList, NotesMetadataList.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = NotesMetadataList()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('findNotesMetadata_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass findNoteCounts_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - filter\n   - withTrash\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'filter', (NoteFilter, NoteFilter.thrift_spec), None, ), # 2\n    (3, TType.BOOL, 'withTrash', None, None, ), # 3\n  )\n\n  def __init__(self, authenticationToken=None, filter=None, withTrash=None,):\n    self.authenticationToken = authenticationToken\n    self.filter = filter\n    self.withTrash = withTrash\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.filter = NoteFilter()\n          self.filter.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.BOOL:\n          self.withTrash = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('findNoteCounts_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.filter is not None:\n      oprot.writeFieldBegin('filter', TType.STRUCT, 2)\n      self.filter.write(oprot)\n      oprot.writeFieldEnd()\n    if self.withTrash is not None:\n      oprot.writeFieldBegin('withTrash', TType.BOOL, 3)\n      oprot.writeBool(self.withTrash)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass findNoteCounts_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (NoteCollectionCounts, NoteCollectionCounts.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = NoteCollectionCounts()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('findNoteCounts_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNote_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n   - withContent\n   - withResourcesData\n   - withResourcesRecognition\n   - withResourcesAlternateData\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n    (3, TType.BOOL, 'withContent', None, None, ), # 3\n    (4, TType.BOOL, 'withResourcesData', None, None, ), # 4\n    (5, TType.BOOL, 'withResourcesRecognition', None, None, ), # 5\n    (6, TType.BOOL, 'withResourcesAlternateData', None, None, ), # 6\n  )\n\n  def __init__(self, authenticationToken=None, guid=None, withContent=None, withResourcesData=None, withResourcesRecognition=None, withResourcesAlternateData=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n    self.withContent = withContent\n    self.withResourcesData = withResourcesData\n    self.withResourcesRecognition = withResourcesRecognition\n    self.withResourcesAlternateData = withResourcesAlternateData\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.BOOL:\n          self.withContent = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.BOOL:\n          self.withResourcesData = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.withResourcesRecognition = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.BOOL:\n          self.withResourcesAlternateData = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNote_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.withContent is not None:\n      oprot.writeFieldBegin('withContent', TType.BOOL, 3)\n      oprot.writeBool(self.withContent)\n      oprot.writeFieldEnd()\n    if self.withResourcesData is not None:\n      oprot.writeFieldBegin('withResourcesData', TType.BOOL, 4)\n      oprot.writeBool(self.withResourcesData)\n      oprot.writeFieldEnd()\n    if self.withResourcesRecognition is not None:\n      oprot.writeFieldBegin('withResourcesRecognition', TType.BOOL, 5)\n      oprot.writeBool(self.withResourcesRecognition)\n      oprot.writeFieldEnd()\n    if self.withResourcesAlternateData is not None:\n      oprot.writeFieldBegin('withResourcesAlternateData', TType.BOOL, 6)\n      oprot.writeBool(self.withResourcesAlternateData)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNote_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Note()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNote_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteApplicationData_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteApplicationData_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteApplicationData_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.LazyMap, evernote.edam.type.ttypes.LazyMap.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.LazyMap()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteApplicationData_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteApplicationDataEntry_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n   - key\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n    (3, TType.STRING, 'key', None, None, ), # 3\n  )\n\n  def __init__(self, authenticationToken=None, guid=None, key=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n    self.key = key\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.key = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteApplicationDataEntry_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.key is not None:\n      oprot.writeFieldBegin('key', TType.STRING, 3)\n      oprot.writeString(self.key)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteApplicationDataEntry_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRING, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRING:\n          self.success = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteApplicationDataEntry_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRING, 0)\n      oprot.writeString(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass setNoteApplicationDataEntry_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n   - key\n   - value\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n    (3, TType.STRING, 'key', None, None, ), # 3\n    (4, TType.STRING, 'value', None, None, ), # 4\n  )\n\n  def __init__(self, authenticationToken=None, guid=None, key=None, value=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n    self.key = key\n    self.value = value\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.key = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.value = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('setNoteApplicationDataEntry_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.key is not None:\n      oprot.writeFieldBegin('key', TType.STRING, 3)\n      oprot.writeString(self.key)\n      oprot.writeFieldEnd()\n    if self.value is not None:\n      oprot.writeFieldBegin('value', TType.STRING, 4)\n      oprot.writeString(self.value)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass setNoteApplicationDataEntry_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('setNoteApplicationDataEntry_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass unsetNoteApplicationDataEntry_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n   - key\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n    (3, TType.STRING, 'key', None, None, ), # 3\n  )\n\n  def __init__(self, authenticationToken=None, guid=None, key=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n    self.key = key\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.key = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('unsetNoteApplicationDataEntry_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.key is not None:\n      oprot.writeFieldBegin('key', TType.STRING, 3)\n      oprot.writeString(self.key)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass unsetNoteApplicationDataEntry_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('unsetNoteApplicationDataEntry_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteContent_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteContent_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteContent_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRING, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRING:\n          self.success = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteContent_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRING, 0)\n      oprot.writeString(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteSearchText_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n   - noteOnly\n   - tokenizeForIndexing\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n    (3, TType.BOOL, 'noteOnly', None, None, ), # 3\n    (4, TType.BOOL, 'tokenizeForIndexing', None, None, ), # 4\n  )\n\n  def __init__(self, authenticationToken=None, guid=None, noteOnly=None, tokenizeForIndexing=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n    self.noteOnly = noteOnly\n    self.tokenizeForIndexing = tokenizeForIndexing\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.BOOL:\n          self.noteOnly = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.BOOL:\n          self.tokenizeForIndexing = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteSearchText_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.noteOnly is not None:\n      oprot.writeFieldBegin('noteOnly', TType.BOOL, 3)\n      oprot.writeBool(self.noteOnly)\n      oprot.writeFieldEnd()\n    if self.tokenizeForIndexing is not None:\n      oprot.writeFieldBegin('tokenizeForIndexing', TType.BOOL, 4)\n      oprot.writeBool(self.tokenizeForIndexing)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteSearchText_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRING, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRING:\n          self.success = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteSearchText_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRING, 0)\n      oprot.writeString(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceSearchText_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceSearchText_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceSearchText_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRING, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRING:\n          self.success = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceSearchText_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRING, 0)\n      oprot.writeString(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteTagNames_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteTagNames_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteTagNames_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.LIST, 'success', (TType.STRING,None), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.LIST:\n          self.success = []\n          (_etype224, _size221) = iprot.readListBegin()\n          for _i225 in xrange(_size221):\n            _elem226 = iprot.readString();\n            self.success.append(_elem226)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteTagNames_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.LIST, 0)\n      oprot.writeListBegin(TType.STRING, len(self.success))\n      for iter227 in self.success:\n        oprot.writeString(iter227)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass createNote_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - note\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'note', (evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, note=None,):\n    self.authenticationToken = authenticationToken\n    self.note = note\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.note = evernote.edam.type.ttypes.Note()\n          self.note.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('createNote_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.note is not None:\n      oprot.writeFieldBegin('note', TType.STRUCT, 2)\n      self.note.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass createNote_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Note()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('createNote_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateNote_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - note\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'note', (evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, note=None,):\n    self.authenticationToken = authenticationToken\n    self.note = note\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.note = evernote.edam.type.ttypes.Note()\n          self.note.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateNote_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.note is not None:\n      oprot.writeFieldBegin('note', TType.STRUCT, 2)\n      self.note.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateNote_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Note()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateNote_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass deleteNote_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('deleteNote_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass deleteNote_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('deleteNote_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeNote_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeNote_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeNote_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeNote_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeNotes_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - noteGuids\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.LIST, 'noteGuids', (TType.STRING,None), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, noteGuids=None,):\n    self.authenticationToken = authenticationToken\n    self.noteGuids = noteGuids\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.LIST:\n          self.noteGuids = []\n          (_etype231, _size228) = iprot.readListBegin()\n          for _i232 in xrange(_size228):\n            _elem233 = iprot.readString();\n            self.noteGuids.append(_elem233)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeNotes_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.noteGuids is not None:\n      oprot.writeFieldBegin('noteGuids', TType.LIST, 2)\n      oprot.writeListBegin(TType.STRING, len(self.noteGuids))\n      for iter234 in self.noteGuids:\n        oprot.writeString(iter234)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeNotes_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeNotes_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeInactiveNotes_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeInactiveNotes_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeInactiveNotes_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeInactiveNotes_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass copyNote_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - noteGuid\n   - toNotebookGuid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'noteGuid', None, None, ), # 2\n    (3, TType.STRING, 'toNotebookGuid', None, None, ), # 3\n  )\n\n  def __init__(self, authenticationToken=None, noteGuid=None, toNotebookGuid=None,):\n    self.authenticationToken = authenticationToken\n    self.noteGuid = noteGuid\n    self.toNotebookGuid = toNotebookGuid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.noteGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.toNotebookGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('copyNote_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.noteGuid is not None:\n      oprot.writeFieldBegin('noteGuid', TType.STRING, 2)\n      oprot.writeString(self.noteGuid)\n      oprot.writeFieldEnd()\n    if self.toNotebookGuid is not None:\n      oprot.writeFieldBegin('toNotebookGuid', TType.STRING, 3)\n      oprot.writeString(self.toNotebookGuid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass copyNote_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Note()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('copyNote_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listNoteVersions_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - noteGuid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'noteGuid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, noteGuid=None,):\n    self.authenticationToken = authenticationToken\n    self.noteGuid = noteGuid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.noteGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listNoteVersions_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.noteGuid is not None:\n      oprot.writeFieldBegin('noteGuid', TType.STRING, 2)\n      oprot.writeString(self.noteGuid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listNoteVersions_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.LIST, 'success', (TType.STRUCT,(NoteVersionId, NoteVersionId.thrift_spec)), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.LIST:\n          self.success = []\n          (_etype238, _size235) = iprot.readListBegin()\n          for _i239 in xrange(_size235):\n            _elem240 = NoteVersionId()\n            _elem240.read(iprot)\n            self.success.append(_elem240)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listNoteVersions_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.LIST, 0)\n      oprot.writeListBegin(TType.STRUCT, len(self.success))\n      for iter241 in self.success:\n        iter241.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteVersion_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - noteGuid\n   - updateSequenceNum\n   - withResourcesData\n   - withResourcesRecognition\n   - withResourcesAlternateData\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'noteGuid', None, None, ), # 2\n    (3, TType.I32, 'updateSequenceNum', None, None, ), # 3\n    (4, TType.BOOL, 'withResourcesData', None, None, ), # 4\n    (5, TType.BOOL, 'withResourcesRecognition', None, None, ), # 5\n    (6, TType.BOOL, 'withResourcesAlternateData', None, None, ), # 6\n  )\n\n  def __init__(self, authenticationToken=None, noteGuid=None, updateSequenceNum=None, withResourcesData=None, withResourcesRecognition=None, withResourcesAlternateData=None,):\n    self.authenticationToken = authenticationToken\n    self.noteGuid = noteGuid\n    self.updateSequenceNum = updateSequenceNum\n    self.withResourcesData = withResourcesData\n    self.withResourcesRecognition = withResourcesRecognition\n    self.withResourcesAlternateData = withResourcesAlternateData\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.noteGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.updateSequenceNum = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.BOOL:\n          self.withResourcesData = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.withResourcesRecognition = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.BOOL:\n          self.withResourcesAlternateData = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteVersion_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.noteGuid is not None:\n      oprot.writeFieldBegin('noteGuid', TType.STRING, 2)\n      oprot.writeString(self.noteGuid)\n      oprot.writeFieldEnd()\n    if self.updateSequenceNum is not None:\n      oprot.writeFieldBegin('updateSequenceNum', TType.I32, 3)\n      oprot.writeI32(self.updateSequenceNum)\n      oprot.writeFieldEnd()\n    if self.withResourcesData is not None:\n      oprot.writeFieldBegin('withResourcesData', TType.BOOL, 4)\n      oprot.writeBool(self.withResourcesData)\n      oprot.writeFieldEnd()\n    if self.withResourcesRecognition is not None:\n      oprot.writeFieldBegin('withResourcesRecognition', TType.BOOL, 5)\n      oprot.writeBool(self.withResourcesRecognition)\n      oprot.writeFieldEnd()\n    if self.withResourcesAlternateData is not None:\n      oprot.writeFieldBegin('withResourcesAlternateData', TType.BOOL, 6)\n      oprot.writeBool(self.withResourcesAlternateData)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteVersion_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Note()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteVersion_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResource_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n   - withData\n   - withRecognition\n   - withAttributes\n   - withAlternateData\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n    (3, TType.BOOL, 'withData', None, None, ), # 3\n    (4, TType.BOOL, 'withRecognition', None, None, ), # 4\n    (5, TType.BOOL, 'withAttributes', None, None, ), # 5\n    (6, TType.BOOL, 'withAlternateData', None, None, ), # 6\n  )\n\n  def __init__(self, authenticationToken=None, guid=None, withData=None, withRecognition=None, withAttributes=None, withAlternateData=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n    self.withData = withData\n    self.withRecognition = withRecognition\n    self.withAttributes = withAttributes\n    self.withAlternateData = withAlternateData\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.BOOL:\n          self.withData = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.BOOL:\n          self.withRecognition = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.withAttributes = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.BOOL:\n          self.withAlternateData = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResource_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.withData is not None:\n      oprot.writeFieldBegin('withData', TType.BOOL, 3)\n      oprot.writeBool(self.withData)\n      oprot.writeFieldEnd()\n    if self.withRecognition is not None:\n      oprot.writeFieldBegin('withRecognition', TType.BOOL, 4)\n      oprot.writeBool(self.withRecognition)\n      oprot.writeFieldEnd()\n    if self.withAttributes is not None:\n      oprot.writeFieldBegin('withAttributes', TType.BOOL, 5)\n      oprot.writeBool(self.withAttributes)\n      oprot.writeFieldEnd()\n    if self.withAlternateData is not None:\n      oprot.writeFieldBegin('withAlternateData', TType.BOOL, 6)\n      oprot.writeBool(self.withAlternateData)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResource_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Resource, evernote.edam.type.ttypes.Resource.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Resource()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResource_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceApplicationData_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceApplicationData_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceApplicationData_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.LazyMap, evernote.edam.type.ttypes.LazyMap.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.LazyMap()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceApplicationData_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceApplicationDataEntry_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n   - key\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n    (3, TType.STRING, 'key', None, None, ), # 3\n  )\n\n  def __init__(self, authenticationToken=None, guid=None, key=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n    self.key = key\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.key = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceApplicationDataEntry_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.key is not None:\n      oprot.writeFieldBegin('key', TType.STRING, 3)\n      oprot.writeString(self.key)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceApplicationDataEntry_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRING, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRING:\n          self.success = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceApplicationDataEntry_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRING, 0)\n      oprot.writeString(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass setResourceApplicationDataEntry_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n   - key\n   - value\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n    (3, TType.STRING, 'key', None, None, ), # 3\n    (4, TType.STRING, 'value', None, None, ), # 4\n  )\n\n  def __init__(self, authenticationToken=None, guid=None, key=None, value=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n    self.key = key\n    self.value = value\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.key = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.value = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('setResourceApplicationDataEntry_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.key is not None:\n      oprot.writeFieldBegin('key', TType.STRING, 3)\n      oprot.writeString(self.key)\n      oprot.writeFieldEnd()\n    if self.value is not None:\n      oprot.writeFieldBegin('value', TType.STRING, 4)\n      oprot.writeString(self.value)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass setResourceApplicationDataEntry_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('setResourceApplicationDataEntry_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass unsetResourceApplicationDataEntry_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n   - key\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n    (3, TType.STRING, 'key', None, None, ), # 3\n  )\n\n  def __init__(self, authenticationToken=None, guid=None, key=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n    self.key = key\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.key = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('unsetResourceApplicationDataEntry_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.key is not None:\n      oprot.writeFieldBegin('key', TType.STRING, 3)\n      oprot.writeString(self.key)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass unsetResourceApplicationDataEntry_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('unsetResourceApplicationDataEntry_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateResource_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - resource\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'resource', (evernote.edam.type.ttypes.Resource, evernote.edam.type.ttypes.Resource.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, resource=None,):\n    self.authenticationToken = authenticationToken\n    self.resource = resource\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.resource = evernote.edam.type.ttypes.Resource()\n          self.resource.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateResource_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.resource is not None:\n      oprot.writeFieldBegin('resource', TType.STRUCT, 2)\n      self.resource.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateResource_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateResource_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceData_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceData_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceData_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRING, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRING:\n          self.success = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceData_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRING, 0)\n      oprot.writeString(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceByHash_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - noteGuid\n   - contentHash\n   - withData\n   - withRecognition\n   - withAlternateData\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'noteGuid', None, None, ), # 2\n    (3, TType.STRING, 'contentHash', None, None, ), # 3\n    (4, TType.BOOL, 'withData', None, None, ), # 4\n    (5, TType.BOOL, 'withRecognition', None, None, ), # 5\n    (6, TType.BOOL, 'withAlternateData', None, None, ), # 6\n  )\n\n  def __init__(self, authenticationToken=None, noteGuid=None, contentHash=None, withData=None, withRecognition=None, withAlternateData=None,):\n    self.authenticationToken = authenticationToken\n    self.noteGuid = noteGuid\n    self.contentHash = contentHash\n    self.withData = withData\n    self.withRecognition = withRecognition\n    self.withAlternateData = withAlternateData\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.noteGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.contentHash = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.BOOL:\n          self.withData = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.withRecognition = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.BOOL:\n          self.withAlternateData = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceByHash_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.noteGuid is not None:\n      oprot.writeFieldBegin('noteGuid', TType.STRING, 2)\n      oprot.writeString(self.noteGuid)\n      oprot.writeFieldEnd()\n    if self.contentHash is not None:\n      oprot.writeFieldBegin('contentHash', TType.STRING, 3)\n      oprot.writeString(self.contentHash)\n      oprot.writeFieldEnd()\n    if self.withData is not None:\n      oprot.writeFieldBegin('withData', TType.BOOL, 4)\n      oprot.writeBool(self.withData)\n      oprot.writeFieldEnd()\n    if self.withRecognition is not None:\n      oprot.writeFieldBegin('withRecognition', TType.BOOL, 5)\n      oprot.writeBool(self.withRecognition)\n      oprot.writeFieldEnd()\n    if self.withAlternateData is not None:\n      oprot.writeFieldBegin('withAlternateData', TType.BOOL, 6)\n      oprot.writeBool(self.withAlternateData)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceByHash_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Resource, evernote.edam.type.ttypes.Resource.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Resource()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceByHash_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceRecognition_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceRecognition_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceRecognition_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRING, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRING:\n          self.success = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceRecognition_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRING, 0)\n      oprot.writeString(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceAlternateData_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceAlternateData_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceAlternateData_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRING, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRING:\n          self.success = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceAlternateData_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRING, 0)\n      oprot.writeString(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceAttributes_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceAttributes_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getResourceAttributes_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.ResourceAttributes, evernote.edam.type.ttypes.ResourceAttributes.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.ResourceAttributes()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getResourceAttributes_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getPublicNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - userId\n   - publicUri\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I32, 'userId', None, None, ), # 1\n    (2, TType.STRING, 'publicUri', None, None, ), # 2\n  )\n\n  def __init__(self, userId=None, publicUri=None,):\n    self.userId = userId\n    self.publicUri = publicUri\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I32:\n          self.userId = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.publicUri = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getPublicNotebook_args')\n    if self.userId is not None:\n      oprot.writeFieldBegin('userId', TType.I32, 1)\n      oprot.writeI32(self.userId)\n      oprot.writeFieldEnd()\n    if self.publicUri is not None:\n      oprot.writeFieldBegin('publicUri', TType.STRING, 2)\n      oprot.writeString(self.publicUri)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getPublicNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.Notebook, evernote.edam.type.ttypes.Notebook.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.Notebook()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getPublicNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 1)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass createSharedNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - sharedNotebook\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'sharedNotebook', (evernote.edam.type.ttypes.SharedNotebook, evernote.edam.type.ttypes.SharedNotebook.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, sharedNotebook=None,):\n    self.authenticationToken = authenticationToken\n    self.sharedNotebook = sharedNotebook\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.sharedNotebook = evernote.edam.type.ttypes.SharedNotebook()\n          self.sharedNotebook.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('createSharedNotebook_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.sharedNotebook is not None:\n      oprot.writeFieldBegin('sharedNotebook', TType.STRUCT, 2)\n      self.sharedNotebook.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass createSharedNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.SharedNotebook, evernote.edam.type.ttypes.SharedNotebook.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.SharedNotebook()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('createSharedNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateSharedNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - sharedNotebook\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'sharedNotebook', (evernote.edam.type.ttypes.SharedNotebook, evernote.edam.type.ttypes.SharedNotebook.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, sharedNotebook=None,):\n    self.authenticationToken = authenticationToken\n    self.sharedNotebook = sharedNotebook\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.sharedNotebook = evernote.edam.type.ttypes.SharedNotebook()\n          self.sharedNotebook.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateSharedNotebook_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.sharedNotebook is not None:\n      oprot.writeFieldBegin('sharedNotebook', TType.STRUCT, 2)\n      self.sharedNotebook.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateSharedNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateSharedNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass setSharedNotebookRecipientSettings_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - sharedNotebookId\n   - recipientSettings\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.I64, 'sharedNotebookId', None, None, ), # 2\n    (3, TType.STRUCT, 'recipientSettings', (evernote.edam.type.ttypes.SharedNotebookRecipientSettings, evernote.edam.type.ttypes.SharedNotebookRecipientSettings.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, authenticationToken=None, sharedNotebookId=None, recipientSettings=None,):\n    self.authenticationToken = authenticationToken\n    self.sharedNotebookId = sharedNotebookId\n    self.recipientSettings = recipientSettings\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I64:\n          self.sharedNotebookId = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.recipientSettings = evernote.edam.type.ttypes.SharedNotebookRecipientSettings()\n          self.recipientSettings.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('setSharedNotebookRecipientSettings_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.sharedNotebookId is not None:\n      oprot.writeFieldBegin('sharedNotebookId', TType.I64, 2)\n      oprot.writeI64(self.sharedNotebookId)\n      oprot.writeFieldEnd()\n    if self.recipientSettings is not None:\n      oprot.writeFieldBegin('recipientSettings', TType.STRUCT, 3)\n      self.recipientSettings.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass setSharedNotebookRecipientSettings_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('setSharedNotebookRecipientSettings_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass sendMessageToSharedNotebookMembers_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - notebookGuid\n   - messageText\n   - recipients\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'notebookGuid', None, None, ), # 2\n    (3, TType.STRING, 'messageText', None, None, ), # 3\n    (4, TType.LIST, 'recipients', (TType.STRING,None), None, ), # 4\n  )\n\n  def __init__(self, authenticationToken=None, notebookGuid=None, messageText=None, recipients=None,):\n    self.authenticationToken = authenticationToken\n    self.notebookGuid = notebookGuid\n    self.messageText = messageText\n    self.recipients = recipients\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.notebookGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.messageText = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.LIST:\n          self.recipients = []\n          (_etype245, _size242) = iprot.readListBegin()\n          for _i246 in xrange(_size242):\n            _elem247 = iprot.readString();\n            self.recipients.append(_elem247)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('sendMessageToSharedNotebookMembers_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.notebookGuid is not None:\n      oprot.writeFieldBegin('notebookGuid', TType.STRING, 2)\n      oprot.writeString(self.notebookGuid)\n      oprot.writeFieldEnd()\n    if self.messageText is not None:\n      oprot.writeFieldBegin('messageText', TType.STRING, 3)\n      oprot.writeString(self.messageText)\n      oprot.writeFieldEnd()\n    if self.recipients is not None:\n      oprot.writeFieldBegin('recipients', TType.LIST, 4)\n      oprot.writeListBegin(TType.STRING, len(self.recipients))\n      for iter248 in self.recipients:\n        oprot.writeString(iter248)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass sendMessageToSharedNotebookMembers_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('sendMessageToSharedNotebookMembers_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listSharedNotebooks_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listSharedNotebooks_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listSharedNotebooks_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.LIST, 'success', (TType.STRUCT,(evernote.edam.type.ttypes.SharedNotebook, evernote.edam.type.ttypes.SharedNotebook.thrift_spec)), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.LIST:\n          self.success = []\n          (_etype252, _size249) = iprot.readListBegin()\n          for _i253 in xrange(_size249):\n            _elem254 = evernote.edam.type.ttypes.SharedNotebook()\n            _elem254.read(iprot)\n            self.success.append(_elem254)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listSharedNotebooks_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.LIST, 0)\n      oprot.writeListBegin(TType.STRUCT, len(self.success))\n      for iter255 in self.success:\n        iter255.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeSharedNotebooks_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - sharedNotebookIds\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.LIST, 'sharedNotebookIds', (TType.I64,None), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, sharedNotebookIds=None,):\n    self.authenticationToken = authenticationToken\n    self.sharedNotebookIds = sharedNotebookIds\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.LIST:\n          self.sharedNotebookIds = []\n          (_etype259, _size256) = iprot.readListBegin()\n          for _i260 in xrange(_size256):\n            _elem261 = iprot.readI64();\n            self.sharedNotebookIds.append(_elem261)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeSharedNotebooks_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.sharedNotebookIds is not None:\n      oprot.writeFieldBegin('sharedNotebookIds', TType.LIST, 2)\n      oprot.writeListBegin(TType.I64, len(self.sharedNotebookIds))\n      for iter262 in self.sharedNotebookIds:\n        oprot.writeI64(iter262)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeSharedNotebooks_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeSharedNotebooks_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass createLinkedNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - linkedNotebook\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'linkedNotebook', (evernote.edam.type.ttypes.LinkedNotebook, evernote.edam.type.ttypes.LinkedNotebook.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, linkedNotebook=None,):\n    self.authenticationToken = authenticationToken\n    self.linkedNotebook = linkedNotebook\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.linkedNotebook = evernote.edam.type.ttypes.LinkedNotebook()\n          self.linkedNotebook.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('createLinkedNotebook_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.linkedNotebook is not None:\n      oprot.writeFieldBegin('linkedNotebook', TType.STRUCT, 2)\n      self.linkedNotebook.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass createLinkedNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.LinkedNotebook, evernote.edam.type.ttypes.LinkedNotebook.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.LinkedNotebook()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('createLinkedNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateLinkedNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - linkedNotebook\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'linkedNotebook', (evernote.edam.type.ttypes.LinkedNotebook, evernote.edam.type.ttypes.LinkedNotebook.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, linkedNotebook=None,):\n    self.authenticationToken = authenticationToken\n    self.linkedNotebook = linkedNotebook\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.linkedNotebook = evernote.edam.type.ttypes.LinkedNotebook()\n          self.linkedNotebook.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateLinkedNotebook_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.linkedNotebook is not None:\n      oprot.writeFieldBegin('linkedNotebook', TType.STRUCT, 2)\n      self.linkedNotebook.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass updateLinkedNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('updateLinkedNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listLinkedNotebooks_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listLinkedNotebooks_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass listLinkedNotebooks_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.LIST, 'success', (TType.STRUCT,(evernote.edam.type.ttypes.LinkedNotebook, evernote.edam.type.ttypes.LinkedNotebook.thrift_spec)), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.LIST:\n          self.success = []\n          (_etype266, _size263) = iprot.readListBegin()\n          for _i267 in xrange(_size263):\n            _elem268 = evernote.edam.type.ttypes.LinkedNotebook()\n            _elem268.read(iprot)\n            self.success.append(_elem268)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('listLinkedNotebooks_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.LIST, 0)\n      oprot.writeListBegin(TType.STRUCT, len(self.success))\n      for iter269 in self.success:\n        iter269.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeLinkedNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeLinkedNotebook_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass expungeLinkedNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.I32, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.I32:\n          self.success = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('expungeLinkedNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.I32, 0)\n      oprot.writeI32(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass authenticateToSharedNotebook_args(object):\n  \"\"\"\n  Attributes:\n   - shareKey\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'shareKey', None, None, ), # 1\n    (2, TType.STRING, 'authenticationToken', None, None, ), # 2\n  )\n\n  def __init__(self, shareKey=None, authenticationToken=None,):\n    self.shareKey = shareKey\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.shareKey = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('authenticateToSharedNotebook_args')\n    if self.shareKey is not None:\n      oprot.writeFieldBegin('shareKey', TType.STRING, 1)\n      oprot.writeString(self.shareKey)\n      oprot.writeFieldEnd()\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 2)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass authenticateToSharedNotebook_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.userstore.ttypes.AuthenticationResult, evernote.edam.userstore.ttypes.AuthenticationResult.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.userstore.ttypes.AuthenticationResult()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('authenticateToSharedNotebook_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getSharedNotebookByAuth_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getSharedNotebookByAuth_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getSharedNotebookByAuth_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.SharedNotebook, evernote.edam.type.ttypes.SharedNotebook.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.SharedNotebook()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getSharedNotebookByAuth_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass emailNote_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - parameters\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'parameters', (NoteEmailParameters, NoteEmailParameters.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, parameters=None,):\n    self.authenticationToken = authenticationToken\n    self.parameters = parameters\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.parameters = NoteEmailParameters()\n          self.parameters.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('emailNote_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.parameters is not None:\n      oprot.writeFieldBegin('parameters', TType.STRUCT, 2)\n      self.parameters.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass emailNote_result(object):\n  \"\"\"\n  Attributes:\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, userException=None, notFoundException=None, systemException=None,):\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('emailNote_result')\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass shareNote_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('shareNote_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass shareNote_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRING, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRING:\n          self.success = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('shareNote_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRING, 0)\n      oprot.writeString(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass stopSharingNote_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - guid\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'guid', None, None, ), # 2\n  )\n\n  def __init__(self, authenticationToken=None, guid=None,):\n    self.authenticationToken = authenticationToken\n    self.guid = guid\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('stopSharingNote_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 2)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass stopSharingNote_result(object):\n  \"\"\"\n  Attributes:\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, userException=None, notFoundException=None, systemException=None,):\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('stopSharingNote_result')\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass authenticateToSharedNote_args(object):\n  \"\"\"\n  Attributes:\n   - guid\n   - noteKey\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'guid', None, None, ), # 1\n    (2, TType.STRING, 'noteKey', None, None, ), # 2\n    (3, TType.STRING, 'authenticationToken', None, None, ), # 3\n  )\n\n  def __init__(self, guid=None, noteKey=None, authenticationToken=None,):\n    self.guid = guid\n    self.noteKey = noteKey\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.noteKey = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('authenticateToSharedNote_args')\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 1)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.noteKey is not None:\n      oprot.writeFieldBegin('noteKey', TType.STRING, 2)\n      oprot.writeString(self.noteKey)\n      oprot.writeFieldEnd()\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 3)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass authenticateToSharedNote_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - notFoundException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.userstore.ttypes.AuthenticationResult, evernote.edam.userstore.ttypes.AuthenticationResult.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, notFoundException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.userstore.ttypes.AuthenticationResult()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('authenticateToSharedNote_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 2)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 3)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass findRelated_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - query\n   - resultSpec\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRUCT, 'query', (RelatedQuery, RelatedQuery.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'resultSpec', (RelatedResultSpec, RelatedResultSpec.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, authenticationToken=None, query=None, resultSpec=None,):\n    self.authenticationToken = authenticationToken\n    self.query = query\n    self.resultSpec = resultSpec\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.query = RelatedQuery()\n          self.query.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.resultSpec = RelatedResultSpec()\n          self.resultSpec.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('findRelated_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.query is not None:\n      oprot.writeFieldBegin('query', TType.STRUCT, 2)\n      self.query.write(oprot)\n      oprot.writeFieldEnd()\n    if self.resultSpec is not None:\n      oprot.writeFieldBegin('resultSpec', TType.STRUCT, 3)\n      self.resultSpec.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass findRelated_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n   - notFoundException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (RelatedResult, RelatedResult.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None, notFoundException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n    self.notFoundException = notFoundException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = RelatedResult()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('findRelated_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 3)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n"
  },
  {
    "path": "lib/evernote/edam/notestore/__init__.py",
    "content": "__all__ = ['ttypes', 'constants', 'NoteStore']\n"
  },
  {
    "path": "lib/evernote/edam/notestore/constants.py",
    "content": "#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nfrom ttypes import *\n\n"
  },
  {
    "path": "lib/evernote/edam/notestore/ttypes.py",
    "content": "#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nimport evernote.edam.userstore.ttypes\nimport evernote.edam.type.ttypes\nimport evernote.edam.error.ttypes\nimport evernote.edam.limits.ttypes\n\n\nfrom thrift.transport import TTransport\nfrom thrift.protocol import TBinaryProtocol, TProtocol\ntry:\n  from thrift.protocol import fastbinary\nexcept:\n  fastbinary = None\n\n\n\nclass SyncState(object):\n  \"\"\"\n   This structure encapsulates the information about the state of the\n   user's account for the purpose of \"state based\" synchronization.\n  <dl>\n   <dt>currentTime</dt>\n     <dd>\n     The server's current date and time.\n     </dd>\n  \n   <dt>fullSyncBefore</dt>\n     <dd>\n     The cutoff date and time for client caches to be\n     updated via incremental synchronization.  Any clients that were last\n     synched with the server before this date/time must do a full resync of all\n     objects.  This cutoff point will change over time as archival data is\n     deleted or special circumstances on the service require resynchronization.\n     </dd>\n  \n   <dt>updateCount</dt>\n     <dd>\n     Indicates the total number of transactions that have\n     been committed within the account.  This reflects (for example) the\n     number of discrete additions or modifications that have been made to\n     the data in this account (tags, notes, resources, etc.).\n     This number is the \"high water mark\" for Update Sequence Numbers (USN)\n     within the account.\n     </dd>\n  \n   <dt>uploaded</dt>\n     <dd>\n     The total number of bytes that have been uploaded to\n     this account in the current monthly period.  This can be compared against\n     Accounting.uploadLimit (from the UserStore) to determine how close the user\n     is to their monthly upload limit.\n     This value may not be present if the SyncState has been retrieved by\n     a caller that only has read access to the account.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - currentTime\n   - fullSyncBefore\n   - updateCount\n   - uploaded\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I64, 'currentTime', None, None, ), # 1\n    (2, TType.I64, 'fullSyncBefore', None, None, ), # 2\n    (3, TType.I32, 'updateCount', None, None, ), # 3\n    (4, TType.I64, 'uploaded', None, None, ), # 4\n  )\n\n  def __init__(self, currentTime=None, fullSyncBefore=None, updateCount=None, uploaded=None,):\n    self.currentTime = currentTime\n    self.fullSyncBefore = fullSyncBefore\n    self.updateCount = updateCount\n    self.uploaded = uploaded\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I64:\n          self.currentTime = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I64:\n          self.fullSyncBefore = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.updateCount = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.I64:\n          self.uploaded = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('SyncState')\n    if self.currentTime is not None:\n      oprot.writeFieldBegin('currentTime', TType.I64, 1)\n      oprot.writeI64(self.currentTime)\n      oprot.writeFieldEnd()\n    if self.fullSyncBefore is not None:\n      oprot.writeFieldBegin('fullSyncBefore', TType.I64, 2)\n      oprot.writeI64(self.fullSyncBefore)\n      oprot.writeFieldEnd()\n    if self.updateCount is not None:\n      oprot.writeFieldBegin('updateCount', TType.I32, 3)\n      oprot.writeI32(self.updateCount)\n      oprot.writeFieldEnd()\n    if self.uploaded is not None:\n      oprot.writeFieldBegin('uploaded', TType.I64, 4)\n      oprot.writeI64(self.uploaded)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.currentTime is None:\n      raise TProtocol.TProtocolException(message='Required field currentTime is unset!')\n    if self.fullSyncBefore is None:\n      raise TProtocol.TProtocolException(message='Required field fullSyncBefore is unset!')\n    if self.updateCount is None:\n      raise TProtocol.TProtocolException(message='Required field updateCount is unset!')\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass SyncChunk(object):\n  \"\"\"\n   This structure is given out by the NoteStore when a client asks to\n   receive the current state of an account.  The client asks for the server's\n   state one chunk at a time in order to allow clients to retrieve the state\n   of a large account without needing to transfer the entire account in\n   a single message.\n  \n   The server always gives SyncChunks using an ascending series of Update\n   Sequence Numbers (USNs).\n  \n  <dl>\n   <dt>currentTime</dt>\n     <dd>\n     The server's current date and time.\n     </dd>\n  \n   <dt>chunkHighUSN</dt>\n     <dd>\n     The highest USN for any of the data objects represented\n     in this sync chunk.  If there are no objects in the chunk, this will not be\n     set.\n     </dd>\n  \n   <dt>updateCount</dt>\n     <dd>\n     The total number of updates that have been performed in\n     the service for this account.  This is equal to the highest USN within the\n     account at the point that this SyncChunk was generated.  If updateCount\n     and chunkHighUSN are identical, that means that this is the last chunk\n     in the account ... there is no more recent information.\n     </dd>\n  \n   <dt>notes</dt>\n     <dd>\n     If present, this is a list of non-expunged notes that\n     have a USN in this chunk.  This will include notes that are \"deleted\"\n     but not expunged (i.e. in the trash).  The notes will include their list\n     of tags and resources, but the note content, resource content, resource\n     recognition data and resource alternate data will not be supplied.\n     </dd>\n  \n   <dt>notebooks</dt>\n     <dd>\n     If present, this is a list of non-expunged notebooks that\n     have a USN in this chunk.  This will include notebooks that are \"deleted\"\n     but not expunged (i.e. in the trash).\n     </dd>\n  \n   <dt>tags</dt>\n     <dd>\n     If present, this is a list of the non-expunged tags that have a\n     USN in this chunk.\n     </dd>\n  \n   <dt>searches</dt>\n     <dd>\n     If present, this is a list of non-expunged searches that\n     have a USN in this chunk.\n     </dd>\n  \n   <dt>resources</dt>\n     <dd>\n     If present, this is a list of the non-expunged resources\n     that have a USN in this chunk.  This will include the metadata for each\n     resource, but not its binary contents or recognition data, which must be\n     retrieved separately.\n     </dd>\n  \n   <dt>expungedNotes</dt>\n     <dd>\n     If present, the GUIDs of all of the notes that were\n     permanently expunged in this chunk.\n     </dd>\n  \n   <dt>expungedNotebooks</dt>\n     <dd>\n     If present, the GUIDs of all of the notebooks that\n     were permanently expunged in this chunk.  When a notebook is expunged,\n     this implies that all of its child notes (and their resources) were\n     also expunged.\n     </dd>\n  \n   <dt>expungedTags</dt>\n     <dd>\n     If present, the GUIDs of all of the tags that were\n     permanently expunged in this chunk.\n     </dd>\n  \n   <dt>expungedSearches</dt>\n     <dd>\n     If present, the GUIDs of all of the saved searches\n     that were permanently expunged in this chunk.\n     </dd>\n  \n   <dt>linkedNotebooks</dt>\n     <dd>\n     If present, this is a list of non-expunged LinkedNotebooks that\n     have a USN in this chunk.\n     </dd>\n  \n   <dt>expungedLinkedNotebooks</dt>\n     <dd>\n     If present, the GUIDs of all of the LinkedNotebooks\n     that were permanently expunged in this chunk.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - currentTime\n   - chunkHighUSN\n   - updateCount\n   - notes\n   - notebooks\n   - tags\n   - searches\n   - resources\n   - expungedNotes\n   - expungedNotebooks\n   - expungedTags\n   - expungedSearches\n   - linkedNotebooks\n   - expungedLinkedNotebooks\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I64, 'currentTime', None, None, ), # 1\n    (2, TType.I32, 'chunkHighUSN', None, None, ), # 2\n    (3, TType.I32, 'updateCount', None, None, ), # 3\n    (4, TType.LIST, 'notes', (TType.STRUCT,(evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec)), None, ), # 4\n    (5, TType.LIST, 'notebooks', (TType.STRUCT,(evernote.edam.type.ttypes.Notebook, evernote.edam.type.ttypes.Notebook.thrift_spec)), None, ), # 5\n    (6, TType.LIST, 'tags', (TType.STRUCT,(evernote.edam.type.ttypes.Tag, evernote.edam.type.ttypes.Tag.thrift_spec)), None, ), # 6\n    (7, TType.LIST, 'searches', (TType.STRUCT,(evernote.edam.type.ttypes.SavedSearch, evernote.edam.type.ttypes.SavedSearch.thrift_spec)), None, ), # 7\n    (8, TType.LIST, 'resources', (TType.STRUCT,(evernote.edam.type.ttypes.Resource, evernote.edam.type.ttypes.Resource.thrift_spec)), None, ), # 8\n    (9, TType.LIST, 'expungedNotes', (TType.STRING,None), None, ), # 9\n    (10, TType.LIST, 'expungedNotebooks', (TType.STRING,None), None, ), # 10\n    (11, TType.LIST, 'expungedTags', (TType.STRING,None), None, ), # 11\n    (12, TType.LIST, 'expungedSearches', (TType.STRING,None), None, ), # 12\n    (13, TType.LIST, 'linkedNotebooks', (TType.STRUCT,(evernote.edam.type.ttypes.LinkedNotebook, evernote.edam.type.ttypes.LinkedNotebook.thrift_spec)), None, ), # 13\n    (14, TType.LIST, 'expungedLinkedNotebooks', (TType.STRING,None), None, ), # 14\n  )\n\n  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,):\n    self.currentTime = currentTime\n    self.chunkHighUSN = chunkHighUSN\n    self.updateCount = updateCount\n    self.notes = notes\n    self.notebooks = notebooks\n    self.tags = tags\n    self.searches = searches\n    self.resources = resources\n    self.expungedNotes = expungedNotes\n    self.expungedNotebooks = expungedNotebooks\n    self.expungedTags = expungedTags\n    self.expungedSearches = expungedSearches\n    self.linkedNotebooks = linkedNotebooks\n    self.expungedLinkedNotebooks = expungedLinkedNotebooks\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I64:\n          self.currentTime = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I32:\n          self.chunkHighUSN = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.updateCount = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.LIST:\n          self.notes = []\n          (_etype3, _size0) = iprot.readListBegin()\n          for _i4 in xrange(_size0):\n            _elem5 = evernote.edam.type.ttypes.Note()\n            _elem5.read(iprot)\n            self.notes.append(_elem5)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.LIST:\n          self.notebooks = []\n          (_etype9, _size6) = iprot.readListBegin()\n          for _i10 in xrange(_size6):\n            _elem11 = evernote.edam.type.ttypes.Notebook()\n            _elem11.read(iprot)\n            self.notebooks.append(_elem11)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.LIST:\n          self.tags = []\n          (_etype15, _size12) = iprot.readListBegin()\n          for _i16 in xrange(_size12):\n            _elem17 = evernote.edam.type.ttypes.Tag()\n            _elem17.read(iprot)\n            self.tags.append(_elem17)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.LIST:\n          self.searches = []\n          (_etype21, _size18) = iprot.readListBegin()\n          for _i22 in xrange(_size18):\n            _elem23 = evernote.edam.type.ttypes.SavedSearch()\n            _elem23.read(iprot)\n            self.searches.append(_elem23)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.LIST:\n          self.resources = []\n          (_etype27, _size24) = iprot.readListBegin()\n          for _i28 in xrange(_size24):\n            _elem29 = evernote.edam.type.ttypes.Resource()\n            _elem29.read(iprot)\n            self.resources.append(_elem29)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.LIST:\n          self.expungedNotes = []\n          (_etype33, _size30) = iprot.readListBegin()\n          for _i34 in xrange(_size30):\n            _elem35 = iprot.readString();\n            self.expungedNotes.append(_elem35)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.LIST:\n          self.expungedNotebooks = []\n          (_etype39, _size36) = iprot.readListBegin()\n          for _i40 in xrange(_size36):\n            _elem41 = iprot.readString();\n            self.expungedNotebooks.append(_elem41)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.LIST:\n          self.expungedTags = []\n          (_etype45, _size42) = iprot.readListBegin()\n          for _i46 in xrange(_size42):\n            _elem47 = iprot.readString();\n            self.expungedTags.append(_elem47)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.LIST:\n          self.expungedSearches = []\n          (_etype51, _size48) = iprot.readListBegin()\n          for _i52 in xrange(_size48):\n            _elem53 = iprot.readString();\n            self.expungedSearches.append(_elem53)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 13:\n        if ftype == TType.LIST:\n          self.linkedNotebooks = []\n          (_etype57, _size54) = iprot.readListBegin()\n          for _i58 in xrange(_size54):\n            _elem59 = evernote.edam.type.ttypes.LinkedNotebook()\n            _elem59.read(iprot)\n            self.linkedNotebooks.append(_elem59)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 14:\n        if ftype == TType.LIST:\n          self.expungedLinkedNotebooks = []\n          (_etype63, _size60) = iprot.readListBegin()\n          for _i64 in xrange(_size60):\n            _elem65 = iprot.readString();\n            self.expungedLinkedNotebooks.append(_elem65)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('SyncChunk')\n    if self.currentTime is not None:\n      oprot.writeFieldBegin('currentTime', TType.I64, 1)\n      oprot.writeI64(self.currentTime)\n      oprot.writeFieldEnd()\n    if self.chunkHighUSN is not None:\n      oprot.writeFieldBegin('chunkHighUSN', TType.I32, 2)\n      oprot.writeI32(self.chunkHighUSN)\n      oprot.writeFieldEnd()\n    if self.updateCount is not None:\n      oprot.writeFieldBegin('updateCount', TType.I32, 3)\n      oprot.writeI32(self.updateCount)\n      oprot.writeFieldEnd()\n    if self.notes is not None:\n      oprot.writeFieldBegin('notes', TType.LIST, 4)\n      oprot.writeListBegin(TType.STRUCT, len(self.notes))\n      for iter66 in self.notes:\n        iter66.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.notebooks is not None:\n      oprot.writeFieldBegin('notebooks', TType.LIST, 5)\n      oprot.writeListBegin(TType.STRUCT, len(self.notebooks))\n      for iter67 in self.notebooks:\n        iter67.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.tags is not None:\n      oprot.writeFieldBegin('tags', TType.LIST, 6)\n      oprot.writeListBegin(TType.STRUCT, len(self.tags))\n      for iter68 in self.tags:\n        iter68.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.searches is not None:\n      oprot.writeFieldBegin('searches', TType.LIST, 7)\n      oprot.writeListBegin(TType.STRUCT, len(self.searches))\n      for iter69 in self.searches:\n        iter69.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.resources is not None:\n      oprot.writeFieldBegin('resources', TType.LIST, 8)\n      oprot.writeListBegin(TType.STRUCT, len(self.resources))\n      for iter70 in self.resources:\n        iter70.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.expungedNotes is not None:\n      oprot.writeFieldBegin('expungedNotes', TType.LIST, 9)\n      oprot.writeListBegin(TType.STRING, len(self.expungedNotes))\n      for iter71 in self.expungedNotes:\n        oprot.writeString(iter71)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.expungedNotebooks is not None:\n      oprot.writeFieldBegin('expungedNotebooks', TType.LIST, 10)\n      oprot.writeListBegin(TType.STRING, len(self.expungedNotebooks))\n      for iter72 in self.expungedNotebooks:\n        oprot.writeString(iter72)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.expungedTags is not None:\n      oprot.writeFieldBegin('expungedTags', TType.LIST, 11)\n      oprot.writeListBegin(TType.STRING, len(self.expungedTags))\n      for iter73 in self.expungedTags:\n        oprot.writeString(iter73)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.expungedSearches is not None:\n      oprot.writeFieldBegin('expungedSearches', TType.LIST, 12)\n      oprot.writeListBegin(TType.STRING, len(self.expungedSearches))\n      for iter74 in self.expungedSearches:\n        oprot.writeString(iter74)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.linkedNotebooks is not None:\n      oprot.writeFieldBegin('linkedNotebooks', TType.LIST, 13)\n      oprot.writeListBegin(TType.STRUCT, len(self.linkedNotebooks))\n      for iter75 in self.linkedNotebooks:\n        iter75.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.expungedLinkedNotebooks is not None:\n      oprot.writeFieldBegin('expungedLinkedNotebooks', TType.LIST, 14)\n      oprot.writeListBegin(TType.STRING, len(self.expungedLinkedNotebooks))\n      for iter76 in self.expungedLinkedNotebooks:\n        oprot.writeString(iter76)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.currentTime is None:\n      raise TProtocol.TProtocolException(message='Required field currentTime is unset!')\n    if self.updateCount is None:\n      raise TProtocol.TProtocolException(message='Required field updateCount is unset!')\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass SyncChunkFilter(object):\n  \"\"\"\n   This structure is used with the 'getFilteredSyncChunk' call to provide\n   fine-grained control over the data that's returned when a client needs\n   to synchronize with the service. Each flag in this structure specifies\n   whether to include one class of data in the results of that call.\n  \n  <dl>\n   <dt>includeNotes</dt>\n     <dd>\n     If true, then the server will include the SyncChunks.notes field\n     </dd>\n  \n   <dt>includeNoteResources</dt>\n     <dd>\n     If true, then the server will include the 'resources' field on all of\n     the Notes that are in SyncChunk.notes.\n     If 'includeNotes' is false, then this will have no effect.\n     </dd>\n  \n   <dt>includeNoteAttributes</dt>\n     <dd>\n     If true, then the server will include the 'attributes' field on all of\n     the Notes that are in SyncChunks.notes.\n     If 'includeNotes' is false, then this will have no effect.\n     </dd>\n  \n   <dt>includeNotebooks</dt>\n     <dd>\n     If true, then the server will include the SyncChunks.notebooks field\n     </dd>\n  \n   <dt>includeTags</dt>\n     <dd>\n     If true, then the server will include the SyncChunks.tags field\n     </dd>\n  \n   <dt>includeSearches</dt>\n     <dd>\n     If true, then the server will include the SyncChunks.searches field\n     </dd>\n  \n   <dt>includeResources</dt>\n     <dd>\n     If true, then the server will include the SyncChunks.resources field.\n     Since the Resources are also provided with their Note\n     (in the Notes.resources list), this is primarily useful for clients that\n     want to watch for changes to individual Resources due to recognition data\n     being added.\n     </dd>\n  \n   <dt>includeLinkedNotebooks</dt>\n     <dd>\n     If true, then the server will include the SyncChunks.linkedNotebooks field.\n     </dd>\n  \n   <dt>includeExpunged</dt>\n     <dd>\n     If true, then the server will include the 'expunged' data for any type\n     of included data.  For example, if 'includeTags' and 'includeExpunged'\n     are both true, then the SyncChunks.expungedTags field will be set with\n     the GUIDs of tags that have been expunged from the server.\n     </dd>\n  \n   <dt>includeNoteApplicationDataFullMap</dt>\n     <dd>\n     If true, then the values for the applicationData map will be filled\n     in, assuming notes and note attributes are being returned.  Otherwise,\n     only the keysOnly field will be filled in.\n     </dd>\n  \n   <dt>includeResourceApplicationDataFullMap</dt>\n     <dd>\n     If true, then the fullMap values for the applicationData map will be\n     filled in, assuming resources and resource attributes are being returned\n     (includeResources is true).  Otherwise, only the keysOnly field will be\n     filled in.\n     </dd>\n  \n   <dt>includeNoteResourceApplicationDataFullMap</dt>\n     <dd>\n     If true, then the fullMap values for the applicationData map will be\n     filled in for resources found inside of notes, assuming resources are\n     being returned in notes (includeNoteResources is true).  Otherwise,\n     only the keysOnly field will be filled in.\n     </dd>\n  \n   <dt>requireNoteContentClass</dt>\n     <dd>\n     If set, then only send notes whose content class matches this value.\n     The value can be a literal match or, if the last character is an\n     asterisk, a prefix match.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - includeNotes\n   - includeNoteResources\n   - includeNoteAttributes\n   - includeNotebooks\n   - includeTags\n   - includeSearches\n   - includeResources\n   - includeLinkedNotebooks\n   - includeExpunged\n   - includeNoteApplicationDataFullMap\n   - includeResourceApplicationDataFullMap\n   - includeNoteResourceApplicationDataFullMap\n   - requireNoteContentClass\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.BOOL, 'includeNotes', None, None, ), # 1\n    (2, TType.BOOL, 'includeNoteResources', None, None, ), # 2\n    (3, TType.BOOL, 'includeNoteAttributes', None, None, ), # 3\n    (4, TType.BOOL, 'includeNotebooks', None, None, ), # 4\n    (5, TType.BOOL, 'includeTags', None, None, ), # 5\n    (6, TType.BOOL, 'includeSearches', None, None, ), # 6\n    (7, TType.BOOL, 'includeResources', None, None, ), # 7\n    (8, TType.BOOL, 'includeLinkedNotebooks', None, None, ), # 8\n    (9, TType.BOOL, 'includeExpunged', None, None, ), # 9\n    (10, TType.BOOL, 'includeNoteApplicationDataFullMap', None, None, ), # 10\n    (11, TType.STRING, 'requireNoteContentClass', None, None, ), # 11\n    (12, TType.BOOL, 'includeResourceApplicationDataFullMap', None, None, ), # 12\n    (13, TType.BOOL, 'includeNoteResourceApplicationDataFullMap', None, None, ), # 13\n  )\n\n  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,):\n    self.includeNotes = includeNotes\n    self.includeNoteResources = includeNoteResources\n    self.includeNoteAttributes = includeNoteAttributes\n    self.includeNotebooks = includeNotebooks\n    self.includeTags = includeTags\n    self.includeSearches = includeSearches\n    self.includeResources = includeResources\n    self.includeLinkedNotebooks = includeLinkedNotebooks\n    self.includeExpunged = includeExpunged\n    self.includeNoteApplicationDataFullMap = includeNoteApplicationDataFullMap\n    self.includeResourceApplicationDataFullMap = includeResourceApplicationDataFullMap\n    self.includeNoteResourceApplicationDataFullMap = includeNoteResourceApplicationDataFullMap\n    self.requireNoteContentClass = requireNoteContentClass\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.BOOL:\n          self.includeNotes = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.BOOL:\n          self.includeNoteResources = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.BOOL:\n          self.includeNoteAttributes = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.BOOL:\n          self.includeNotebooks = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.includeTags = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.BOOL:\n          self.includeSearches = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.BOOL:\n          self.includeResources = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.BOOL:\n          self.includeLinkedNotebooks = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.BOOL:\n          self.includeExpunged = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.BOOL:\n          self.includeNoteApplicationDataFullMap = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.BOOL:\n          self.includeResourceApplicationDataFullMap = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 13:\n        if ftype == TType.BOOL:\n          self.includeNoteResourceApplicationDataFullMap = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.STRING:\n          self.requireNoteContentClass = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('SyncChunkFilter')\n    if self.includeNotes is not None:\n      oprot.writeFieldBegin('includeNotes', TType.BOOL, 1)\n      oprot.writeBool(self.includeNotes)\n      oprot.writeFieldEnd()\n    if self.includeNoteResources is not None:\n      oprot.writeFieldBegin('includeNoteResources', TType.BOOL, 2)\n      oprot.writeBool(self.includeNoteResources)\n      oprot.writeFieldEnd()\n    if self.includeNoteAttributes is not None:\n      oprot.writeFieldBegin('includeNoteAttributes', TType.BOOL, 3)\n      oprot.writeBool(self.includeNoteAttributes)\n      oprot.writeFieldEnd()\n    if self.includeNotebooks is not None:\n      oprot.writeFieldBegin('includeNotebooks', TType.BOOL, 4)\n      oprot.writeBool(self.includeNotebooks)\n      oprot.writeFieldEnd()\n    if self.includeTags is not None:\n      oprot.writeFieldBegin('includeTags', TType.BOOL, 5)\n      oprot.writeBool(self.includeTags)\n      oprot.writeFieldEnd()\n    if self.includeSearches is not None:\n      oprot.writeFieldBegin('includeSearches', TType.BOOL, 6)\n      oprot.writeBool(self.includeSearches)\n      oprot.writeFieldEnd()\n    if self.includeResources is not None:\n      oprot.writeFieldBegin('includeResources', TType.BOOL, 7)\n      oprot.writeBool(self.includeResources)\n      oprot.writeFieldEnd()\n    if self.includeLinkedNotebooks is not None:\n      oprot.writeFieldBegin('includeLinkedNotebooks', TType.BOOL, 8)\n      oprot.writeBool(self.includeLinkedNotebooks)\n      oprot.writeFieldEnd()\n    if self.includeExpunged is not None:\n      oprot.writeFieldBegin('includeExpunged', TType.BOOL, 9)\n      oprot.writeBool(self.includeExpunged)\n      oprot.writeFieldEnd()\n    if self.includeNoteApplicationDataFullMap is not None:\n      oprot.writeFieldBegin('includeNoteApplicationDataFullMap', TType.BOOL, 10)\n      oprot.writeBool(self.includeNoteApplicationDataFullMap)\n      oprot.writeFieldEnd()\n    if self.requireNoteContentClass is not None:\n      oprot.writeFieldBegin('requireNoteContentClass', TType.STRING, 11)\n      oprot.writeString(self.requireNoteContentClass)\n      oprot.writeFieldEnd()\n    if self.includeResourceApplicationDataFullMap is not None:\n      oprot.writeFieldBegin('includeResourceApplicationDataFullMap', TType.BOOL, 12)\n      oprot.writeBool(self.includeResourceApplicationDataFullMap)\n      oprot.writeFieldEnd()\n    if self.includeNoteResourceApplicationDataFullMap is not None:\n      oprot.writeFieldBegin('includeNoteResourceApplicationDataFullMap', TType.BOOL, 13)\n      oprot.writeBool(self.includeNoteResourceApplicationDataFullMap)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass NoteFilter(object):\n  \"\"\"\n   A list of criteria that are used to indicate which notes are desired from\n   the account.  This is used in queries to the NoteStore to determine\n   which notes should be retrieved.\n  \n  <dl>\n   <dt>order</dt>\n     <dd>\n     The NoteSortOrder value indicating what criterion should be\n     used to sort the results of the filter.\n     </dd>\n  \n   <dt>ascending</dt>\n     <dd>\n     If true, the results will be ascending in the requested\n     sort order.  If false, the results will be descending.\n     </dd>\n  \n   <dt>words</dt>\n     <dd>\n     If present, a search query string that will filter the set of notes to be returned.\n     Accepts the full search grammar documented in the Evernote API Overview.\n     </dd>\n  \n   <dt>notebookGuid</dt>\n     <dd>\n     If present, the Guid of the notebook that must contain\n     the notes.\n     </dd>\n  \n   <dt>tagGuids</dt>\n     <dd>\n     If present, the list of tags (by GUID) that must be present\n     on the notes.\n     </dd>\n  \n   <dt>timeZone</dt>\n     <dd>\n     The zone ID for the user, which will be used to interpret\n     any dates or times in the queries that do not include their desired zone\n     information.\n     For example, if a query requests notes created \"yesterday\", this\n     will be evaluated from the provided time zone, if provided.\n     The format must be encoded as a standard zone ID such as\n     \"America/Los_Angeles\".\n     </dd>\n  \n   <dt>inactive</dt>\n     <dd>\n     If true, then only notes that are not active (i.e. notes in\n     the Trash) will be returned. Otherwise, only active notes will be returned.\n     There is no way to find both active and inactive notes in a single query.\n     </dd>\n  \n   <dt>emphasized</dt>\n     <dd>\n     If present, a search query string that may or may not influence the notes\n     to be returned, both in terms of coverage as well as of order. Think of it\n     as a wish list, not a requirement.\n     Accepts the full search grammar documented in the Evernote API Overview.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - order\n   - ascending\n   - words\n   - notebookGuid\n   - tagGuids\n   - timeZone\n   - inactive\n   - emphasized\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I32, 'order', None, None, ), # 1\n    (2, TType.BOOL, 'ascending', None, None, ), # 2\n    (3, TType.STRING, 'words', None, None, ), # 3\n    (4, TType.STRING, 'notebookGuid', None, None, ), # 4\n    (5, TType.LIST, 'tagGuids', (TType.STRING,None), None, ), # 5\n    (6, TType.STRING, 'timeZone', None, None, ), # 6\n    (7, TType.BOOL, 'inactive', None, None, ), # 7\n    (8, TType.STRING, 'emphasized', None, None, ), # 8\n  )\n\n  def __init__(self, order=None, ascending=None, words=None, notebookGuid=None, tagGuids=None, timeZone=None, inactive=None, emphasized=None,):\n    self.order = order\n    self.ascending = ascending\n    self.words = words\n    self.notebookGuid = notebookGuid\n    self.tagGuids = tagGuids\n    self.timeZone = timeZone\n    self.inactive = inactive\n    self.emphasized = emphasized\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I32:\n          self.order = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.BOOL:\n          self.ascending = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.words = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.notebookGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.LIST:\n          self.tagGuids = []\n          (_etype80, _size77) = iprot.readListBegin()\n          for _i81 in xrange(_size77):\n            _elem82 = iprot.readString();\n            self.tagGuids.append(_elem82)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.STRING:\n          self.timeZone = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.BOOL:\n          self.inactive = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.STRING:\n          self.emphasized = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('NoteFilter')\n    if self.order is not None:\n      oprot.writeFieldBegin('order', TType.I32, 1)\n      oprot.writeI32(self.order)\n      oprot.writeFieldEnd()\n    if self.ascending is not None:\n      oprot.writeFieldBegin('ascending', TType.BOOL, 2)\n      oprot.writeBool(self.ascending)\n      oprot.writeFieldEnd()\n    if self.words is not None:\n      oprot.writeFieldBegin('words', TType.STRING, 3)\n      oprot.writeString(self.words)\n      oprot.writeFieldEnd()\n    if self.notebookGuid is not None:\n      oprot.writeFieldBegin('notebookGuid', TType.STRING, 4)\n      oprot.writeString(self.notebookGuid)\n      oprot.writeFieldEnd()\n    if self.tagGuids is not None:\n      oprot.writeFieldBegin('tagGuids', TType.LIST, 5)\n      oprot.writeListBegin(TType.STRING, len(self.tagGuids))\n      for iter83 in self.tagGuids:\n        oprot.writeString(iter83)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.timeZone is not None:\n      oprot.writeFieldBegin('timeZone', TType.STRING, 6)\n      oprot.writeString(self.timeZone)\n      oprot.writeFieldEnd()\n    if self.inactive is not None:\n      oprot.writeFieldBegin('inactive', TType.BOOL, 7)\n      oprot.writeBool(self.inactive)\n      oprot.writeFieldEnd()\n    if self.emphasized is not None:\n      oprot.writeFieldBegin('emphasized', TType.STRING, 8)\n      oprot.writeString(self.emphasized)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass NoteList(object):\n  \"\"\"\n   A small structure for returning a list of notes out of a larger set.\n  \n  <dl>\n   <dt>startIndex</dt>\n     <dd>\n     The starting index within the overall set of notes.  This\n     is also the number of notes that are \"before\" this list in the set.\n     </dd>\n  \n   <dt>totalNotes</dt>\n     <dd>\n     The number of notes in the larger set.  This can be used\n     to calculate how many notes are \"after\" this note in the set.\n     (I.e.  remaining = totalNotes - (startIndex + notes.length)  )\n     </dd>\n  \n   <dt>notes</dt>\n     <dd>\n     The list of notes from this range.  The Notes will include all\n     metadata (attributes, resources, etc.), but will not include the ENML\n     content of the note or the binary contents of any resources.\n     </dd>\n  \n   <dt>stoppedWords</dt>\n     <dd>\n     If the NoteList was produced using a text based search\n     query that included words that are not indexed or searched by the service,\n     this will include a list of those ignored words.\n     </dd>\n  \n   <dt>searchedWords</dt>\n     <dd>\n     If the NoteList was produced using a text based search\n     query that included viable search words or quoted expressions, this will\n     include a list of those words.  Any stopped words will not be included\n     in this list.\n     </dd>\n  \n   <dt>updateCount</dt>\n     <dd>\n     Indicates the total number of transactions that have\n     been committed within the account.  This reflects (for example) the\n     number of discrete additions or modifications that have been made to\n     the data in this account (tags, notes, resources, etc.).\n     This number is the \"high water mark\" for Update Sequence Numbers (USN)\n     within the account.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - startIndex\n   - totalNotes\n   - notes\n   - stoppedWords\n   - searchedWords\n   - updateCount\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I32, 'startIndex', None, None, ), # 1\n    (2, TType.I32, 'totalNotes', None, None, ), # 2\n    (3, TType.LIST, 'notes', (TType.STRUCT,(evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec)), None, ), # 3\n    (4, TType.LIST, 'stoppedWords', (TType.STRING,None), None, ), # 4\n    (5, TType.LIST, 'searchedWords', (TType.STRING,None), None, ), # 5\n    (6, TType.I32, 'updateCount', None, None, ), # 6\n  )\n\n  def __init__(self, startIndex=None, totalNotes=None, notes=None, stoppedWords=None, searchedWords=None, updateCount=None,):\n    self.startIndex = startIndex\n    self.totalNotes = totalNotes\n    self.notes = notes\n    self.stoppedWords = stoppedWords\n    self.searchedWords = searchedWords\n    self.updateCount = updateCount\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I32:\n          self.startIndex = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I32:\n          self.totalNotes = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.LIST:\n          self.notes = []\n          (_etype87, _size84) = iprot.readListBegin()\n          for _i88 in xrange(_size84):\n            _elem89 = evernote.edam.type.ttypes.Note()\n            _elem89.read(iprot)\n            self.notes.append(_elem89)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.LIST:\n          self.stoppedWords = []\n          (_etype93, _size90) = iprot.readListBegin()\n          for _i94 in xrange(_size90):\n            _elem95 = iprot.readString();\n            self.stoppedWords.append(_elem95)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.LIST:\n          self.searchedWords = []\n          (_etype99, _size96) = iprot.readListBegin()\n          for _i100 in xrange(_size96):\n            _elem101 = iprot.readString();\n            self.searchedWords.append(_elem101)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.I32:\n          self.updateCount = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('NoteList')\n    if self.startIndex is not None:\n      oprot.writeFieldBegin('startIndex', TType.I32, 1)\n      oprot.writeI32(self.startIndex)\n      oprot.writeFieldEnd()\n    if self.totalNotes is not None:\n      oprot.writeFieldBegin('totalNotes', TType.I32, 2)\n      oprot.writeI32(self.totalNotes)\n      oprot.writeFieldEnd()\n    if self.notes is not None:\n      oprot.writeFieldBegin('notes', TType.LIST, 3)\n      oprot.writeListBegin(TType.STRUCT, len(self.notes))\n      for iter102 in self.notes:\n        iter102.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.stoppedWords is not None:\n      oprot.writeFieldBegin('stoppedWords', TType.LIST, 4)\n      oprot.writeListBegin(TType.STRING, len(self.stoppedWords))\n      for iter103 in self.stoppedWords:\n        oprot.writeString(iter103)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.searchedWords is not None:\n      oprot.writeFieldBegin('searchedWords', TType.LIST, 5)\n      oprot.writeListBegin(TType.STRING, len(self.searchedWords))\n      for iter104 in self.searchedWords:\n        oprot.writeString(iter104)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.updateCount is not None:\n      oprot.writeFieldBegin('updateCount', TType.I32, 6)\n      oprot.writeI32(self.updateCount)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.startIndex is None:\n      raise TProtocol.TProtocolException(message='Required field startIndex is unset!')\n    if self.totalNotes is None:\n      raise TProtocol.TProtocolException(message='Required field totalNotes is unset!')\n    if self.notes is None:\n      raise TProtocol.TProtocolException(message='Required field notes is unset!')\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass NoteMetadata(object):\n  \"\"\"\n  This structure is used in the set of results returned by the\n  findNotesMetadata function.  It represents the high-level information about\n  a single Note, without some of the larger deep structure.  This allows\n  for the information about a list of Notes to be returned relatively quickly\n  with less marshalling and data transfer to remote clients.\n  Most fields in this structure are identical to the corresponding field in\n  the Note structure, with the exception of:\n  \n  <dl>\n  <dt>largestResourceMime</dt>\n    <dd>If set, then this will contain the MIME type of the largest Resource\n    (in bytes) within the Note.  This may be useful, for example, to choose\n    an appropriate icon or thumbnail to represent the Note.\n    </dd>\n  \n  <dt>largestResourceSize</dt>\n   <dd>If set, this will contain the size of the largest Resource file, in\n   bytes, within the Note.  This may be useful, for example, to decide whether\n   to ask the server for a thumbnail to represent the Note.\n   </dd>\n  </dl>\n  \n  Attributes:\n   - guid\n   - title\n   - contentLength\n   - created\n   - updated\n   - deleted\n   - updateSequenceNum\n   - notebookGuid\n   - tagGuids\n   - attributes\n   - largestResourceMime\n   - largestResourceSize\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'guid', None, None, ), # 1\n    (2, TType.STRING, 'title', None, None, ), # 2\n    None, # 3\n    None, # 4\n    (5, TType.I32, 'contentLength', None, None, ), # 5\n    (6, TType.I64, 'created', None, None, ), # 6\n    (7, TType.I64, 'updated', None, None, ), # 7\n    (8, TType.I64, 'deleted', None, None, ), # 8\n    None, # 9\n    (10, TType.I32, 'updateSequenceNum', None, None, ), # 10\n    (11, TType.STRING, 'notebookGuid', None, None, ), # 11\n    (12, TType.LIST, 'tagGuids', (TType.STRING,None), None, ), # 12\n    None, # 13\n    (14, TType.STRUCT, 'attributes', (evernote.edam.type.ttypes.NoteAttributes, evernote.edam.type.ttypes.NoteAttributes.thrift_spec), None, ), # 14\n    None, # 15\n    None, # 16\n    None, # 17\n    None, # 18\n    None, # 19\n    (20, TType.STRING, 'largestResourceMime', None, None, ), # 20\n    (21, TType.I32, 'largestResourceSize', None, None, ), # 21\n  )\n\n  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,):\n    self.guid = guid\n    self.title = title\n    self.contentLength = contentLength\n    self.created = created\n    self.updated = updated\n    self.deleted = deleted\n    self.updateSequenceNum = updateSequenceNum\n    self.notebookGuid = notebookGuid\n    self.tagGuids = tagGuids\n    self.attributes = attributes\n    self.largestResourceMime = largestResourceMime\n    self.largestResourceSize = largestResourceSize\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.title = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.I32:\n          self.contentLength = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.I64:\n          self.created = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.I64:\n          self.updated = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.I64:\n          self.deleted = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.I32:\n          self.updateSequenceNum = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.STRING:\n          self.notebookGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.LIST:\n          self.tagGuids = []\n          (_etype108, _size105) = iprot.readListBegin()\n          for _i109 in xrange(_size105):\n            _elem110 = iprot.readString();\n            self.tagGuids.append(_elem110)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 14:\n        if ftype == TType.STRUCT:\n          self.attributes = evernote.edam.type.ttypes.NoteAttributes()\n          self.attributes.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 20:\n        if ftype == TType.STRING:\n          self.largestResourceMime = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 21:\n        if ftype == TType.I32:\n          self.largestResourceSize = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('NoteMetadata')\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 1)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.title is not None:\n      oprot.writeFieldBegin('title', TType.STRING, 2)\n      oprot.writeString(self.title)\n      oprot.writeFieldEnd()\n    if self.contentLength is not None:\n      oprot.writeFieldBegin('contentLength', TType.I32, 5)\n      oprot.writeI32(self.contentLength)\n      oprot.writeFieldEnd()\n    if self.created is not None:\n      oprot.writeFieldBegin('created', TType.I64, 6)\n      oprot.writeI64(self.created)\n      oprot.writeFieldEnd()\n    if self.updated is not None:\n      oprot.writeFieldBegin('updated', TType.I64, 7)\n      oprot.writeI64(self.updated)\n      oprot.writeFieldEnd()\n    if self.deleted is not None:\n      oprot.writeFieldBegin('deleted', TType.I64, 8)\n      oprot.writeI64(self.deleted)\n      oprot.writeFieldEnd()\n    if self.updateSequenceNum is not None:\n      oprot.writeFieldBegin('updateSequenceNum', TType.I32, 10)\n      oprot.writeI32(self.updateSequenceNum)\n      oprot.writeFieldEnd()\n    if self.notebookGuid is not None:\n      oprot.writeFieldBegin('notebookGuid', TType.STRING, 11)\n      oprot.writeString(self.notebookGuid)\n      oprot.writeFieldEnd()\n    if self.tagGuids is not None:\n      oprot.writeFieldBegin('tagGuids', TType.LIST, 12)\n      oprot.writeListBegin(TType.STRING, len(self.tagGuids))\n      for iter111 in self.tagGuids:\n        oprot.writeString(iter111)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.attributes is not None:\n      oprot.writeFieldBegin('attributes', TType.STRUCT, 14)\n      self.attributes.write(oprot)\n      oprot.writeFieldEnd()\n    if self.largestResourceMime is not None:\n      oprot.writeFieldBegin('largestResourceMime', TType.STRING, 20)\n      oprot.writeString(self.largestResourceMime)\n      oprot.writeFieldEnd()\n    if self.largestResourceSize is not None:\n      oprot.writeFieldBegin('largestResourceSize', TType.I32, 21)\n      oprot.writeI32(self.largestResourceSize)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.guid is None:\n      raise TProtocol.TProtocolException(message='Required field guid is unset!')\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass NotesMetadataList(object):\n  \"\"\"\n   This structure is returned from calls to the findNotesMetadata function to\n   give the high-level metadata about a subset of Notes that are found to\n   match a specified NoteFilter in a search.\n  \n  <dl>\n   <dt>startIndex</dt>\n     <dd>\n     The starting index within the overall set of notes.  This\n     is also the number of notes that are \"before\" this list in the set.\n     </dd>\n  \n   <dt>totalNotes</dt>\n     <dd>\n     The number of notes in the larger set.  This can be used\n     to calculate how many notes are \"after\" this note in the set.\n     (I.e.  remaining = totalNotes - (startIndex + notes.length)  )\n     </dd>\n  \n   <dt>notes</dt>\n     <dd>\n     The list of metadata for Notes in this range.  The set of optional fields\n     that are set in each metadata structure will depend on the\n     NotesMetadataResultSpec provided by the caller when the search was\n     performed.  Only the 'guid' field will be guaranteed to be set in each\n     Note.\n     </dd>\n  \n   <dt>stoppedWords</dt>\n     <dd>\n     If the NoteList was produced using a text based search\n     query that included words that are not indexed or searched by the service,\n     this will include a list of those ignored words.\n     </dd>\n  \n   <dt>searchedWords</dt>\n     <dd>\n     If the NoteList was produced using a text based search\n     query that included viable search words or quoted expressions, this will\n     include a list of those words.  Any stopped words will not be included\n     in this list.\n     </dd>\n  \n   <dt>updateCount</dt>\n     <dd>\n     Indicates the total number of transactions that have\n     been committed within the account.  This reflects (for example) the\n     number of discrete additions or modifications that have been made to\n     the data in this account (tags, notes, resources, etc.).\n     This number is the \"high water mark\" for Update Sequence Numbers (USN)\n     within the account.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - startIndex\n   - totalNotes\n   - notes\n   - stoppedWords\n   - searchedWords\n   - updateCount\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I32, 'startIndex', None, None, ), # 1\n    (2, TType.I32, 'totalNotes', None, None, ), # 2\n    (3, TType.LIST, 'notes', (TType.STRUCT,(NoteMetadata, NoteMetadata.thrift_spec)), None, ), # 3\n    (4, TType.LIST, 'stoppedWords', (TType.STRING,None), None, ), # 4\n    (5, TType.LIST, 'searchedWords', (TType.STRING,None), None, ), # 5\n    (6, TType.I32, 'updateCount', None, None, ), # 6\n  )\n\n  def __init__(self, startIndex=None, totalNotes=None, notes=None, stoppedWords=None, searchedWords=None, updateCount=None,):\n    self.startIndex = startIndex\n    self.totalNotes = totalNotes\n    self.notes = notes\n    self.stoppedWords = stoppedWords\n    self.searchedWords = searchedWords\n    self.updateCount = updateCount\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I32:\n          self.startIndex = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I32:\n          self.totalNotes = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.LIST:\n          self.notes = []\n          (_etype115, _size112) = iprot.readListBegin()\n          for _i116 in xrange(_size112):\n            _elem117 = NoteMetadata()\n            _elem117.read(iprot)\n            self.notes.append(_elem117)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.LIST:\n          self.stoppedWords = []\n          (_etype121, _size118) = iprot.readListBegin()\n          for _i122 in xrange(_size118):\n            _elem123 = iprot.readString();\n            self.stoppedWords.append(_elem123)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.LIST:\n          self.searchedWords = []\n          (_etype127, _size124) = iprot.readListBegin()\n          for _i128 in xrange(_size124):\n            _elem129 = iprot.readString();\n            self.searchedWords.append(_elem129)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.I32:\n          self.updateCount = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('NotesMetadataList')\n    if self.startIndex is not None:\n      oprot.writeFieldBegin('startIndex', TType.I32, 1)\n      oprot.writeI32(self.startIndex)\n      oprot.writeFieldEnd()\n    if self.totalNotes is not None:\n      oprot.writeFieldBegin('totalNotes', TType.I32, 2)\n      oprot.writeI32(self.totalNotes)\n      oprot.writeFieldEnd()\n    if self.notes is not None:\n      oprot.writeFieldBegin('notes', TType.LIST, 3)\n      oprot.writeListBegin(TType.STRUCT, len(self.notes))\n      for iter130 in self.notes:\n        iter130.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.stoppedWords is not None:\n      oprot.writeFieldBegin('stoppedWords', TType.LIST, 4)\n      oprot.writeListBegin(TType.STRING, len(self.stoppedWords))\n      for iter131 in self.stoppedWords:\n        oprot.writeString(iter131)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.searchedWords is not None:\n      oprot.writeFieldBegin('searchedWords', TType.LIST, 5)\n      oprot.writeListBegin(TType.STRING, len(self.searchedWords))\n      for iter132 in self.searchedWords:\n        oprot.writeString(iter132)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.updateCount is not None:\n      oprot.writeFieldBegin('updateCount', TType.I32, 6)\n      oprot.writeI32(self.updateCount)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.startIndex is None:\n      raise TProtocol.TProtocolException(message='Required field startIndex is unset!')\n    if self.totalNotes is None:\n      raise TProtocol.TProtocolException(message='Required field totalNotes is unset!')\n    if self.notes is None:\n      raise TProtocol.TProtocolException(message='Required field notes is unset!')\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass NotesMetadataResultSpec(object):\n  \"\"\"\n  This structure is provided to the findNotesMetadata function to specify\n  the subset of fields that should be included in each NoteMetadata element\n  that is returned in the NotesMetadataList.\n  Each field on this structure is a boolean flag that indicates whether the\n  corresponding field should be included in the NoteMetadata structure when\n  it is returned.  For example, if the 'includeTitle' field is set on this\n  structure when calling findNotesMetadata, then each NoteMetadata in the\n  list should have its 'title' field set.\n  If one of the fields in this spec is not set, then it will be treated as\n  'false' by the server, so the default behavior is to include nothing in\n  replies (but the mandatory GUID)\n  \n  Attributes:\n   - includeTitle\n   - includeContentLength\n   - includeCreated\n   - includeUpdated\n   - includeDeleted\n   - includeUpdateSequenceNum\n   - includeNotebookGuid\n   - includeTagGuids\n   - includeAttributes\n   - includeLargestResourceMime\n   - includeLargestResourceSize\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    None, # 1\n    (2, TType.BOOL, 'includeTitle', None, None, ), # 2\n    None, # 3\n    None, # 4\n    (5, TType.BOOL, 'includeContentLength', None, None, ), # 5\n    (6, TType.BOOL, 'includeCreated', None, None, ), # 6\n    (7, TType.BOOL, 'includeUpdated', None, None, ), # 7\n    (8, TType.BOOL, 'includeDeleted', None, None, ), # 8\n    None, # 9\n    (10, TType.BOOL, 'includeUpdateSequenceNum', None, None, ), # 10\n    (11, TType.BOOL, 'includeNotebookGuid', None, None, ), # 11\n    (12, TType.BOOL, 'includeTagGuids', None, None, ), # 12\n    None, # 13\n    (14, TType.BOOL, 'includeAttributes', None, None, ), # 14\n    None, # 15\n    None, # 16\n    None, # 17\n    None, # 18\n    None, # 19\n    (20, TType.BOOL, 'includeLargestResourceMime', None, None, ), # 20\n    (21, TType.BOOL, 'includeLargestResourceSize', None, None, ), # 21\n  )\n\n  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,):\n    self.includeTitle = includeTitle\n    self.includeContentLength = includeContentLength\n    self.includeCreated = includeCreated\n    self.includeUpdated = includeUpdated\n    self.includeDeleted = includeDeleted\n    self.includeUpdateSequenceNum = includeUpdateSequenceNum\n    self.includeNotebookGuid = includeNotebookGuid\n    self.includeTagGuids = includeTagGuids\n    self.includeAttributes = includeAttributes\n    self.includeLargestResourceMime = includeLargestResourceMime\n    self.includeLargestResourceSize = includeLargestResourceSize\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 2:\n        if ftype == TType.BOOL:\n          self.includeTitle = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.includeContentLength = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.BOOL:\n          self.includeCreated = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.BOOL:\n          self.includeUpdated = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.BOOL:\n          self.includeDeleted = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.BOOL:\n          self.includeUpdateSequenceNum = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.BOOL:\n          self.includeNotebookGuid = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.BOOL:\n          self.includeTagGuids = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 14:\n        if ftype == TType.BOOL:\n          self.includeAttributes = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 20:\n        if ftype == TType.BOOL:\n          self.includeLargestResourceMime = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 21:\n        if ftype == TType.BOOL:\n          self.includeLargestResourceSize = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('NotesMetadataResultSpec')\n    if self.includeTitle is not None:\n      oprot.writeFieldBegin('includeTitle', TType.BOOL, 2)\n      oprot.writeBool(self.includeTitle)\n      oprot.writeFieldEnd()\n    if self.includeContentLength is not None:\n      oprot.writeFieldBegin('includeContentLength', TType.BOOL, 5)\n      oprot.writeBool(self.includeContentLength)\n      oprot.writeFieldEnd()\n    if self.includeCreated is not None:\n      oprot.writeFieldBegin('includeCreated', TType.BOOL, 6)\n      oprot.writeBool(self.includeCreated)\n      oprot.writeFieldEnd()\n    if self.includeUpdated is not None:\n      oprot.writeFieldBegin('includeUpdated', TType.BOOL, 7)\n      oprot.writeBool(self.includeUpdated)\n      oprot.writeFieldEnd()\n    if self.includeDeleted is not None:\n      oprot.writeFieldBegin('includeDeleted', TType.BOOL, 8)\n      oprot.writeBool(self.includeDeleted)\n      oprot.writeFieldEnd()\n    if self.includeUpdateSequenceNum is not None:\n      oprot.writeFieldBegin('includeUpdateSequenceNum', TType.BOOL, 10)\n      oprot.writeBool(self.includeUpdateSequenceNum)\n      oprot.writeFieldEnd()\n    if self.includeNotebookGuid is not None:\n      oprot.writeFieldBegin('includeNotebookGuid', TType.BOOL, 11)\n      oprot.writeBool(self.includeNotebookGuid)\n      oprot.writeFieldEnd()\n    if self.includeTagGuids is not None:\n      oprot.writeFieldBegin('includeTagGuids', TType.BOOL, 12)\n      oprot.writeBool(self.includeTagGuids)\n      oprot.writeFieldEnd()\n    if self.includeAttributes is not None:\n      oprot.writeFieldBegin('includeAttributes', TType.BOOL, 14)\n      oprot.writeBool(self.includeAttributes)\n      oprot.writeFieldEnd()\n    if self.includeLargestResourceMime is not None:\n      oprot.writeFieldBegin('includeLargestResourceMime', TType.BOOL, 20)\n      oprot.writeBool(self.includeLargestResourceMime)\n      oprot.writeFieldEnd()\n    if self.includeLargestResourceSize is not None:\n      oprot.writeFieldBegin('includeLargestResourceSize', TType.BOOL, 21)\n      oprot.writeBool(self.includeLargestResourceSize)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass NoteCollectionCounts(object):\n  \"\"\"\n   A data structure representing the number of notes for each notebook\n   and tag with a non-zero set of applicable notes.\n  \n  <dl>\n   <dt>notebookCounts</dt>\n     <dd>\n     A mapping from the Notebook GUID to the number of\n     notes (from some selection) that are in the corresponding notebook.\n     </dd>\n  \n   <dt>tagCounts</dt>\n     <dd>\n     A mapping from the Tag GUID to the number of notes (from some\n     selection) that have the corresponding tag.\n     </dd>\n  \n   <dt>trashCount</dt>\n     <dd>\n     If this is set, then this is the number of notes that are in the trash.\n     If this is not set, then the number of notes in the trash hasn't been\n     reported.  (I.e. if there are no notes in the trash, this will be set\n     to 0.)\n     </dd>\n   </dl>\n  \n  Attributes:\n   - notebookCounts\n   - tagCounts\n   - trashCount\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.MAP, 'notebookCounts', (TType.STRING,None,TType.I32,None), None, ), # 1\n    (2, TType.MAP, 'tagCounts', (TType.STRING,None,TType.I32,None), None, ), # 2\n    (3, TType.I32, 'trashCount', None, None, ), # 3\n  )\n\n  def __init__(self, notebookCounts=None, tagCounts=None, trashCount=None,):\n    self.notebookCounts = notebookCounts\n    self.tagCounts = tagCounts\n    self.trashCount = trashCount\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.MAP:\n          self.notebookCounts = {}\n          (_ktype134, _vtype135, _size133 ) = iprot.readMapBegin() \n          for _i137 in xrange(_size133):\n            _key138 = iprot.readString();\n            _val139 = iprot.readI32();\n            self.notebookCounts[_key138] = _val139\n          iprot.readMapEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.MAP:\n          self.tagCounts = {}\n          (_ktype141, _vtype142, _size140 ) = iprot.readMapBegin() \n          for _i144 in xrange(_size140):\n            _key145 = iprot.readString();\n            _val146 = iprot.readI32();\n            self.tagCounts[_key145] = _val146\n          iprot.readMapEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.trashCount = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('NoteCollectionCounts')\n    if self.notebookCounts is not None:\n      oprot.writeFieldBegin('notebookCounts', TType.MAP, 1)\n      oprot.writeMapBegin(TType.STRING, TType.I32, len(self.notebookCounts))\n      for kiter147,viter148 in self.notebookCounts.items():\n        oprot.writeString(kiter147)\n        oprot.writeI32(viter148)\n      oprot.writeMapEnd()\n      oprot.writeFieldEnd()\n    if self.tagCounts is not None:\n      oprot.writeFieldBegin('tagCounts', TType.MAP, 2)\n      oprot.writeMapBegin(TType.STRING, TType.I32, len(self.tagCounts))\n      for kiter149,viter150 in self.tagCounts.items():\n        oprot.writeString(kiter149)\n        oprot.writeI32(viter150)\n      oprot.writeMapEnd()\n      oprot.writeFieldEnd()\n    if self.trashCount is not None:\n      oprot.writeFieldBegin('trashCount', TType.I32, 3)\n      oprot.writeI32(self.trashCount)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass NoteEmailParameters(object):\n  \"\"\"\n  Parameters that must be given to the NoteStore emailNote call. These allow\n  the caller to specify the note to send, the recipient addresses, etc.\n  \n  <dl>\n   <dt>guid</dt>\n     <dd>\n       If set, this must be the GUID of a note within the user's account that\n       should be retrieved from the service and sent as email.  If not set,\n       the 'note' field must be provided instead.\n     </dd>\n  \n   <dt>note</dt>\n     <dd>\n       If the 'guid' field is not set, this field must be provided, including\n       the full contents of the note note (and all of its Resources) to send.\n       This can be used for a Note that as not been created in the service,\n       for example by a local client with local notes.\n     </dd>\n  \n   <dt>toAddresses</dt>\n     <dd>\n       If provided, this should contain a list of the SMTP email addresses\n       that should be included in the \"To:\" line of the email.\n       Callers must specify at least one \"to\" or \"cc\" email address.\n     </dd>\n  \n   <dt>ccAddresses</dt>\n     <dd>\n       If provided, this should contain a list of the SMTP email addresses\n       that should be included in the \"Cc:\" line of the email.\n       Callers must specify at least one \"to\" or \"cc\" email address.\n     </dd>\n  \n   <dt>subject</dt>\n     <dd>\n       If provided, this should contain the subject line of the email that\n       will be sent.  If not provided, the title of the note will be used\n       as the subject of the email.\n     </dd>\n  \n   <dt>message</dt>\n     <dd>\n       If provided, this is additional personal text that should be included\n       into the email as a message from the owner to the recipient(s).\n     </dd>\n  </dl>\n  \n  Attributes:\n   - guid\n   - note\n   - toAddresses\n   - ccAddresses\n   - subject\n   - message\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'guid', None, None, ), # 1\n    (2, TType.STRUCT, 'note', (evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec), None, ), # 2\n    (3, TType.LIST, 'toAddresses', (TType.STRING,None), None, ), # 3\n    (4, TType.LIST, 'ccAddresses', (TType.STRING,None), None, ), # 4\n    (5, TType.STRING, 'subject', None, None, ), # 5\n    (6, TType.STRING, 'message', None, None, ), # 6\n  )\n\n  def __init__(self, guid=None, note=None, toAddresses=None, ccAddresses=None, subject=None, message=None,):\n    self.guid = guid\n    self.note = note\n    self.toAddresses = toAddresses\n    self.ccAddresses = ccAddresses\n    self.subject = subject\n    self.message = message\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.note = evernote.edam.type.ttypes.Note()\n          self.note.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.LIST:\n          self.toAddresses = []\n          (_etype154, _size151) = iprot.readListBegin()\n          for _i155 in xrange(_size151):\n            _elem156 = iprot.readString();\n            self.toAddresses.append(_elem156)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.LIST:\n          self.ccAddresses = []\n          (_etype160, _size157) = iprot.readListBegin()\n          for _i161 in xrange(_size157):\n            _elem162 = iprot.readString();\n            self.ccAddresses.append(_elem162)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.STRING:\n          self.subject = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.STRING:\n          self.message = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('NoteEmailParameters')\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 1)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.note is not None:\n      oprot.writeFieldBegin('note', TType.STRUCT, 2)\n      self.note.write(oprot)\n      oprot.writeFieldEnd()\n    if self.toAddresses is not None:\n      oprot.writeFieldBegin('toAddresses', TType.LIST, 3)\n      oprot.writeListBegin(TType.STRING, len(self.toAddresses))\n      for iter163 in self.toAddresses:\n        oprot.writeString(iter163)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.ccAddresses is not None:\n      oprot.writeFieldBegin('ccAddresses', TType.LIST, 4)\n      oprot.writeListBegin(TType.STRING, len(self.ccAddresses))\n      for iter164 in self.ccAddresses:\n        oprot.writeString(iter164)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.subject is not None:\n      oprot.writeFieldBegin('subject', TType.STRING, 5)\n      oprot.writeString(self.subject)\n      oprot.writeFieldEnd()\n    if self.message is not None:\n      oprot.writeFieldBegin('message', TType.STRING, 6)\n      oprot.writeString(self.message)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass NoteVersionId(object):\n  \"\"\"\n  Identifying information about previous versions of a note that are backed up\n  within Evernote's servers.  Used in the return value of the listNoteVersions\n  call.\n  \n  <dl>\n   <dt>updateSequenceNum</dt>\n   <dd>\n     The update sequence number for the Note when it last had this content.\n     This serves to uniquely identify each version of the note, since USN\n     values are unique within an account for each update.\n   </dd>\n   <dt>updated</dt>\n   <dd>\n     The 'updated' time that was set on the Note when it had this version\n     of the content.  This is the user-modifiable modification time on the\n     note, so it's not reliable for guaranteeing the order of various\n     versions.  (E.g. if someone modifies the note, then changes this time\n     manually into the past and then updates the note again.)\n   </dd>\n   <dt>saved</dt>\n   <dd>\n     A timestamp that holds the date and time when this version of the note\n     was backed up by Evernote's servers.  This\n   </dd>\n   <dt>title</dt>\n   <dd>\n     The title of the note when this particular version was saved.  (The\n     current title of the note may differ from this value.)\n   </dd>\n  </dl>\n  \n  Attributes:\n   - updateSequenceNum\n   - updated\n   - saved\n   - title\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I32, 'updateSequenceNum', None, None, ), # 1\n    (2, TType.I64, 'updated', None, None, ), # 2\n    (3, TType.I64, 'saved', None, None, ), # 3\n    (4, TType.STRING, 'title', None, None, ), # 4\n  )\n\n  def __init__(self, updateSequenceNum=None, updated=None, saved=None, title=None,):\n    self.updateSequenceNum = updateSequenceNum\n    self.updated = updated\n    self.saved = saved\n    self.title = title\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I32:\n          self.updateSequenceNum = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I64:\n          self.updated = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I64:\n          self.saved = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.title = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('NoteVersionId')\n    if self.updateSequenceNum is not None:\n      oprot.writeFieldBegin('updateSequenceNum', TType.I32, 1)\n      oprot.writeI32(self.updateSequenceNum)\n      oprot.writeFieldEnd()\n    if self.updated is not None:\n      oprot.writeFieldBegin('updated', TType.I64, 2)\n      oprot.writeI64(self.updated)\n      oprot.writeFieldEnd()\n    if self.saved is not None:\n      oprot.writeFieldBegin('saved', TType.I64, 3)\n      oprot.writeI64(self.saved)\n      oprot.writeFieldEnd()\n    if self.title is not None:\n      oprot.writeFieldBegin('title', TType.STRING, 4)\n      oprot.writeString(self.title)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.updateSequenceNum is None:\n      raise TProtocol.TProtocolException(message='Required field updateSequenceNum is unset!')\n    if self.updated is None:\n      raise TProtocol.TProtocolException(message='Required field updated is unset!')\n    if self.saved is None:\n      raise TProtocol.TProtocolException(message='Required field saved is unset!')\n    if self.title is None:\n      raise TProtocol.TProtocolException(message='Required field title is unset!')\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass ClientUsageMetrics(object):\n  \"\"\"\n  This structure is passed from clients to the Evernote service when they wish\n  to relay coarse-grained usage metrics to the service to help improve\n  products.\n  \n  <dl>\n   <dt>sessions</dt>\n   <dd>\n     This field contains a count of the number of usage \"sessions\" that have\n     occurred with this client which have not previously been reported to\n     the service.\n     A \"session\" is defined as one of the 96 fifteen-minute intervals of the\n     day when someone used Evernote's interface at least once.\n     So if a user interacts with an Evernote client at 12:18, 12:24, and 12:36,\n     and then the client synchronizes at 12:39, it would report that there were\n     two previously-unreported sessions (one session for the 12:15-12:30 time\n     period, and one for the 12:30-12:45 period).\n     If the user used Evernote again at 12:41 and synchronized at 12:43, it\n     would not report any new sessions, because the 12:30-12:45 session had\n     already been reported.\n   </dd>\n  </dl>\n  \n  Attributes:\n   - sessions\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I32, 'sessions', None, None, ), # 1\n  )\n\n  def __init__(self, sessions=None,):\n    self.sessions = sessions\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I32:\n          self.sessions = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('ClientUsageMetrics')\n    if self.sessions is not None:\n      oprot.writeFieldBegin('sessions', TType.I32, 1)\n      oprot.writeI32(self.sessions)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass RelatedQuery(object):\n  \"\"\"\n  A description of the thing for which we are searching for related\n  entities.\n  \n  You must specify either <em>noteGuid</em> or <em>plainText</em>, but\n  not both. <em>filter</em> and <em>referenceUri</em> are optional.\n  \n  <dl>\n  <dt>noteGuid</dt>\n  <dd>The GUID of an existing note in your account for which related\n      entities will be found.</dd>\n  \n  <dt>plainText</dt>\n  <dd>A string of plain text for which to find related entities.\n      You should provide a text block with a number of characters between\n      EDAM_RELATED_PLAINTEXT_LEN_MIN and EDAM_RELATED_PLAINTEXT_LEN_MAX.\n      </dd>\n  \n  <dt>filter</dt>\n  <dd>The list of criteria that will constrain the notes being considered\n      related.\n      Please note that some of the parameters may be ignored, such as\n      <em>order</em> and <em>ascending</em>.\n  </dd>\n  \n  <dt>referenceUri</dt>\n  <dd>A URI string specifying a reference entity, around which \"relatedness\"\n      should be based. This can be an URL pointing to a web page, for example.\n  </dd>\n  </dl>\n  \n  Attributes:\n   - noteGuid\n   - plainText\n   - filter\n   - referenceUri\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'noteGuid', None, None, ), # 1\n    (2, TType.STRING, 'plainText', None, None, ), # 2\n    (3, TType.STRUCT, 'filter', (NoteFilter, NoteFilter.thrift_spec), None, ), # 3\n    (4, TType.STRING, 'referenceUri', None, None, ), # 4\n  )\n\n  def __init__(self, noteGuid=None, plainText=None, filter=None, referenceUri=None,):\n    self.noteGuid = noteGuid\n    self.plainText = plainText\n    self.filter = filter\n    self.referenceUri = referenceUri\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.noteGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.plainText = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.filter = NoteFilter()\n          self.filter.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.referenceUri = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('RelatedQuery')\n    if self.noteGuid is not None:\n      oprot.writeFieldBegin('noteGuid', TType.STRING, 1)\n      oprot.writeString(self.noteGuid)\n      oprot.writeFieldEnd()\n    if self.plainText is not None:\n      oprot.writeFieldBegin('plainText', TType.STRING, 2)\n      oprot.writeString(self.plainText)\n      oprot.writeFieldEnd()\n    if self.filter is not None:\n      oprot.writeFieldBegin('filter', TType.STRUCT, 3)\n      self.filter.write(oprot)\n      oprot.writeFieldEnd()\n    if self.referenceUri is not None:\n      oprot.writeFieldBegin('referenceUri', TType.STRING, 4)\n      oprot.writeString(self.referenceUri)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass RelatedResult(object):\n  \"\"\"\n  The result of calling findRelated().  The contents of the notes,\n  notebooks, and tags fields will be in decreasing order of expected\n  relevance.  It is possible that fewer results than requested will be\n  returned even if there are enough distinct entities in the account\n  in cases where the relevance is estimated to be low.\n  \n  <dl>\n  <dt>notes</dt>\n  <dd>If notes have been requested to be included, this will be the\n      list of notes.</dd>\n  \n  <dt>notebooks</dt>\n  <dd>If notebooks have been requested to be included, this will be the\n      list of notebooks.</dd>\n  \n  <dt>tags</dt>\n  <dd>If tags have been requested to be included, this will be the list\n      of tags.</dd>\n  </dl>\n  \n  <dt>containingNotebooks</dt>\n  <dd>If <code>includeContainingNotebooks</code> is set to <code>true</code>\n      in the RelatedResultSpec, return the list of notebooks to\n      to which the returned related notes belong. The notebooks in this\n      list will occur once per notebook GUID and are represented as\n      NotebookDescriptor objects.</dd>\n  </dl>\n  </dl>\n  \n  Attributes:\n   - notes\n   - notebooks\n   - tags\n   - containingNotebooks\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.LIST, 'notes', (TType.STRUCT,(evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec)), None, ), # 1\n    (2, TType.LIST, 'notebooks', (TType.STRUCT,(evernote.edam.type.ttypes.Notebook, evernote.edam.type.ttypes.Notebook.thrift_spec)), None, ), # 2\n    (3, TType.LIST, 'tags', (TType.STRUCT,(evernote.edam.type.ttypes.Tag, evernote.edam.type.ttypes.Tag.thrift_spec)), None, ), # 3\n    (4, TType.LIST, 'containingNotebooks', (TType.STRUCT,(evernote.edam.type.ttypes.NotebookDescriptor, evernote.edam.type.ttypes.NotebookDescriptor.thrift_spec)), None, ), # 4\n  )\n\n  def __init__(self, notes=None, notebooks=None, tags=None, containingNotebooks=None,):\n    self.notes = notes\n    self.notebooks = notebooks\n    self.tags = tags\n    self.containingNotebooks = containingNotebooks\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.LIST:\n          self.notes = []\n          (_etype168, _size165) = iprot.readListBegin()\n          for _i169 in xrange(_size165):\n            _elem170 = evernote.edam.type.ttypes.Note()\n            _elem170.read(iprot)\n            self.notes.append(_elem170)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.LIST:\n          self.notebooks = []\n          (_etype174, _size171) = iprot.readListBegin()\n          for _i175 in xrange(_size171):\n            _elem176 = evernote.edam.type.ttypes.Notebook()\n            _elem176.read(iprot)\n            self.notebooks.append(_elem176)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.LIST:\n          self.tags = []\n          (_etype180, _size177) = iprot.readListBegin()\n          for _i181 in xrange(_size177):\n            _elem182 = evernote.edam.type.ttypes.Tag()\n            _elem182.read(iprot)\n            self.tags.append(_elem182)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.LIST:\n          self.containingNotebooks = []\n          (_etype186, _size183) = iprot.readListBegin()\n          for _i187 in xrange(_size183):\n            _elem188 = evernote.edam.type.ttypes.NotebookDescriptor()\n            _elem188.read(iprot)\n            self.containingNotebooks.append(_elem188)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('RelatedResult')\n    if self.notes is not None:\n      oprot.writeFieldBegin('notes', TType.LIST, 1)\n      oprot.writeListBegin(TType.STRUCT, len(self.notes))\n      for iter189 in self.notes:\n        iter189.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.notebooks is not None:\n      oprot.writeFieldBegin('notebooks', TType.LIST, 2)\n      oprot.writeListBegin(TType.STRUCT, len(self.notebooks))\n      for iter190 in self.notebooks:\n        iter190.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.tags is not None:\n      oprot.writeFieldBegin('tags', TType.LIST, 3)\n      oprot.writeListBegin(TType.STRUCT, len(self.tags))\n      for iter191 in self.tags:\n        iter191.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.containingNotebooks is not None:\n      oprot.writeFieldBegin('containingNotebooks', TType.LIST, 4)\n      oprot.writeListBegin(TType.STRUCT, len(self.containingNotebooks))\n      for iter192 in self.containingNotebooks:\n        iter192.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass RelatedResultSpec(object):\n  \"\"\"\n  A description of the thing for which the service will find related\n  entities, via findRelated(), together with a description of what\n  type of entities and how many you are seeking in the\n  RelatedResult.\n  \n  <dl>\n  <dt>maxNotes</dt>\n  <dd>Return notes that are related to the query, but no more than\n      this many.  Any value greater than EDAM_RELATED_MAX_NOTES\n      will be silently capped.  If you do not set this field, then\n      no notes will be returned.</dd>\n  \n  <dt>maxNotebooks</dt>\n  <dd>Return notebooks that are related to the query, but no more than\n      this many.  Any value greater than EDAM_RELATED_MAX_NOTEBOOKS\n      will be silently capped.  If you do not set this field, then\n      no notebooks will be returned.</dd>\n  \n  <dt>maxTags</dt>\n  <dd>Return tags that are related to the query, but no more than\n      this many.  Any value greater than EDAM_RELATED_MAX_TAGS\n      will be silently capped.  If you do not set this field, then\n      no tags will be returned.</dd>\n  </dl>\n  \n  <dt>writableNotebooksOnly</dt>\n  <dd>Require that all returned related notebooks are writable.\n      The user will be able to create notes in all returned notebooks.\n      However, individual notes returned may still belong to notebooks\n      in which the user lacks the ability to create notes.</dd>\n  </dl>\n  \n  <dt>includeContainingNotebooks</dt>\n  <dd>If set to <code>true</code>, return the containingNotebooks field\n      in the RelatedResult, which will contain the list of notebooks to\n      to which the returned related notes belong.</dd>\n  </dl>\n  </dl>\n  \n  Attributes:\n   - maxNotes\n   - maxNotebooks\n   - maxTags\n   - writableNotebooksOnly\n   - includeContainingNotebooks\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I32, 'maxNotes', None, None, ), # 1\n    (2, TType.I32, 'maxNotebooks', None, None, ), # 2\n    (3, TType.I32, 'maxTags', None, None, ), # 3\n    (4, TType.BOOL, 'writableNotebooksOnly', None, None, ), # 4\n    (5, TType.BOOL, 'includeContainingNotebooks', None, None, ), # 5\n  )\n\n  def __init__(self, maxNotes=None, maxNotebooks=None, maxTags=None, writableNotebooksOnly=None, includeContainingNotebooks=None,):\n    self.maxNotes = maxNotes\n    self.maxNotebooks = maxNotebooks\n    self.maxTags = maxTags\n    self.writableNotebooksOnly = writableNotebooksOnly\n    self.includeContainingNotebooks = includeContainingNotebooks\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I32:\n          self.maxNotes = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I32:\n          self.maxNotebooks = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.maxTags = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.BOOL:\n          self.writableNotebooksOnly = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.includeContainingNotebooks = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('RelatedResultSpec')\n    if self.maxNotes is not None:\n      oprot.writeFieldBegin('maxNotes', TType.I32, 1)\n      oprot.writeI32(self.maxNotes)\n      oprot.writeFieldEnd()\n    if self.maxNotebooks is not None:\n      oprot.writeFieldBegin('maxNotebooks', TType.I32, 2)\n      oprot.writeI32(self.maxNotebooks)\n      oprot.writeFieldEnd()\n    if self.maxTags is not None:\n      oprot.writeFieldBegin('maxTags', TType.I32, 3)\n      oprot.writeI32(self.maxTags)\n      oprot.writeFieldEnd()\n    if self.writableNotebooksOnly is not None:\n      oprot.writeFieldBegin('writableNotebooksOnly', TType.BOOL, 4)\n      oprot.writeBool(self.writableNotebooksOnly)\n      oprot.writeFieldEnd()\n    if self.includeContainingNotebooks is not None:\n      oprot.writeFieldBegin('includeContainingNotebooks', TType.BOOL, 5)\n      oprot.writeBool(self.includeContainingNotebooks)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n"
  },
  {
    "path": "lib/evernote/edam/type/__init__.py",
    "content": "__all__ = ['ttypes', 'constants']\n"
  },
  {
    "path": "lib/evernote/edam/type/constants.py",
    "content": "#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nfrom ttypes import *\n\nCLASSIFICATION_RECIPE_USER_NON_RECIPE = \"000\"\nCLASSIFICATION_RECIPE_USER_RECIPE = \"001\"\nCLASSIFICATION_RECIPE_SERVICE_RECIPE = \"002\"\nEDAM_NOTE_SOURCE_WEB_CLIP = \"web.clip\"\nEDAM_NOTE_SOURCE_MAIL_CLIP = \"mail.clip\"\nEDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY = \"mail.smtp\"\n"
  },
  {
    "path": "lib/evernote/edam/type/ttypes.py",
    "content": "#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nimport evernote.edam.limits.ttypes\n\n\nfrom thrift.transport import TTransport\nfrom thrift.protocol import TBinaryProtocol, TProtocol\ntry:\n  from thrift.protocol import fastbinary\nexcept:\n  fastbinary = None\n\n\nclass PrivilegeLevel(object):\n  \"\"\"\n  This enumeration defines the possible permission levels for a user.\n  Free accounts will have a level of NORMAL and paid Premium accounts\n  will have a level of PREMIUM.\n  \"\"\"\n  NORMAL = 1\n  PREMIUM = 3\n  VIP = 5\n  MANAGER = 7\n  SUPPORT = 8\n  ADMIN = 9\n\n  _VALUES_TO_NAMES = {\n    1: \"NORMAL\",\n    3: \"PREMIUM\",\n    5: \"VIP\",\n    7: \"MANAGER\",\n    8: \"SUPPORT\",\n    9: \"ADMIN\",\n  }\n\n  _NAMES_TO_VALUES = {\n    \"NORMAL\": 1,\n    \"PREMIUM\": 3,\n    \"VIP\": 5,\n    \"MANAGER\": 7,\n    \"SUPPORT\": 8,\n    \"ADMIN\": 9,\n  }\n\nclass QueryFormat(object):\n  \"\"\"\n  Every search query is specified as a sequence of characters.\n  Currently, only the USER query format is supported.\n  \"\"\"\n  USER = 1\n  SEXP = 2\n\n  _VALUES_TO_NAMES = {\n    1: \"USER\",\n    2: \"SEXP\",\n  }\n\n  _NAMES_TO_VALUES = {\n    \"USER\": 1,\n    \"SEXP\": 2,\n  }\n\nclass NoteSortOrder(object):\n  \"\"\"\n  This enumeration defines the possible sort ordering for notes when\n  they are returned from a search result.\n  \"\"\"\n  CREATED = 1\n  UPDATED = 2\n  RELEVANCE = 3\n  UPDATE_SEQUENCE_NUMBER = 4\n  TITLE = 5\n\n  _VALUES_TO_NAMES = {\n    1: \"CREATED\",\n    2: \"UPDATED\",\n    3: \"RELEVANCE\",\n    4: \"UPDATE_SEQUENCE_NUMBER\",\n    5: \"TITLE\",\n  }\n\n  _NAMES_TO_VALUES = {\n    \"CREATED\": 1,\n    \"UPDATED\": 2,\n    \"RELEVANCE\": 3,\n    \"UPDATE_SEQUENCE_NUMBER\": 4,\n    \"TITLE\": 5,\n  }\n\nclass PremiumOrderStatus(object):\n  \"\"\"\n  This enumeration defines the possible states of a premium account\n  \n  NONE:    the user has never attempted to become a premium subscriber\n  \n  PENDING: the user has requested a premium account but their charge has not\n    been confirmed\n  \n  ACTIVE:  the user has been charged and their premium account is in good\n   standing\n  \n  FAILED:  the system attempted to charge the was denied. Their premium\n    privileges have been revoked. We will periodically attempt to re-validate\n    their order.\n  \n  CANCELLATION_PENDING: the user has requested that no further charges be made\n    but the current account is still active.\n  \n  CANCELED: the premium account was canceled either because of failure to pay\n    or user cancelation. No more attempts will be made to activate the account.\n  \"\"\"\n  NONE = 0\n  PENDING = 1\n  ACTIVE = 2\n  FAILED = 3\n  CANCELLATION_PENDING = 4\n  CANCELED = 5\n\n  _VALUES_TO_NAMES = {\n    0: \"NONE\",\n    1: \"PENDING\",\n    2: \"ACTIVE\",\n    3: \"FAILED\",\n    4: \"CANCELLATION_PENDING\",\n    5: \"CANCELED\",\n  }\n\n  _NAMES_TO_VALUES = {\n    \"NONE\": 0,\n    \"PENDING\": 1,\n    \"ACTIVE\": 2,\n    \"FAILED\": 3,\n    \"CANCELLATION_PENDING\": 4,\n    \"CANCELED\": 5,\n  }\n\nclass SharedNotebookPrivilegeLevel(object):\n  \"\"\"\n  Privilege levels for accessing shared notebooks.\n  \n  READ_NOTEBOOK: Recipient is able to read the contents of the shared notebook\n    but does to have access to information about other recipients of the\n    notebook or the activity stream information.\n  \n  MODIFY_NOTEBOOK_PLUS_ACTIVITY: Recipient has rights to read and modify the contents\n    of the shared notebook, including the right to move notes to the trash and to create\n    notes in the notebook.  The recipient can also access information about other\n    recipients and the activity stream.\n  \n  READ_NOTEBOOK_PLUS_ACTIVITY: Recipient has READ_NOTEBOOK rights and can also\n    access information about other recipients and the activity stream.\n  \n  GROUP: If the user belongs to a group, such as a Business, that has a defined\n    privilege level, use the privilege level of the group as the privilege for\n    the individual.\n  \n  FULL_ACCESS: Recipient has full rights to the shared notebook and recipient lists,\n    including privilege to revoke and create invitations and to change privilege\n    levels on invitations for individuals.  This privilege level is primarily intended\n    for use by individual shares.\n  \n  BUSINESS_FULL_ACCESS: Intended for use with Business Notebooks, a\n  BUSINESS_FULL_ACCESS level is FULL_ACCESS with the additional rights to\n  change how the notebook will appear in the business library, including the\n  rights to publish and unpublish the notebook from the library.\n  \"\"\"\n  READ_NOTEBOOK = 0\n  MODIFY_NOTEBOOK_PLUS_ACTIVITY = 1\n  READ_NOTEBOOK_PLUS_ACTIVITY = 2\n  GROUP = 3\n  FULL_ACCESS = 4\n  BUSINESS_FULL_ACCESS = 5\n\n  _VALUES_TO_NAMES = {\n    0: \"READ_NOTEBOOK\",\n    1: \"MODIFY_NOTEBOOK_PLUS_ACTIVITY\",\n    2: \"READ_NOTEBOOK_PLUS_ACTIVITY\",\n    3: \"GROUP\",\n    4: \"FULL_ACCESS\",\n    5: \"BUSINESS_FULL_ACCESS\",\n  }\n\n  _NAMES_TO_VALUES = {\n    \"READ_NOTEBOOK\": 0,\n    \"MODIFY_NOTEBOOK_PLUS_ACTIVITY\": 1,\n    \"READ_NOTEBOOK_PLUS_ACTIVITY\": 2,\n    \"GROUP\": 3,\n    \"FULL_ACCESS\": 4,\n    \"BUSINESS_FULL_ACCESS\": 5,\n  }\n\nclass SponsoredGroupRole(object):\n  \"\"\"\n  Enumeration of the roles that a User can have within a sponsored group.\n  \n  GROUP_MEMBER: The user is a member of the group with no special privileges.\n  \n  GROUP_ADMIN: The user is an administrator within the group.\n  \n  GROUP_OWNER: The user is the owner of the group.\n  \"\"\"\n  GROUP_MEMBER = 1\n  GROUP_ADMIN = 2\n  GROUP_OWNER = 3\n\n  _VALUES_TO_NAMES = {\n    1: \"GROUP_MEMBER\",\n    2: \"GROUP_ADMIN\",\n    3: \"GROUP_OWNER\",\n  }\n\n  _NAMES_TO_VALUES = {\n    \"GROUP_MEMBER\": 1,\n    \"GROUP_ADMIN\": 2,\n    \"GROUP_OWNER\": 3,\n  }\n\nclass BusinessUserRole(object):\n  \"\"\"\n  Enumeration of the roles that a User can have within an Evernote Business account.\n  \n  ADMIN: The user is an administrator of the Evernote Business account.\n  \n  NORMAL: The user is a regular user within the Evernote Business account.\n  \"\"\"\n  ADMIN = 1\n  NORMAL = 2\n\n  _VALUES_TO_NAMES = {\n    1: \"ADMIN\",\n    2: \"NORMAL\",\n  }\n\n  _NAMES_TO_VALUES = {\n    \"ADMIN\": 1,\n    \"NORMAL\": 2,\n  }\n\nclass SharedNotebookInstanceRestrictions(object):\n  \"\"\"\n  An enumeration describing restrictions on the domain of shared notebook\n  instances that are valid for a given operation, as used, for example, in\n  NotebookRestrictions.\n  \n  ONLY_JOINED_OR_PREVIEW: The domain consists of shared notebooks that\n    \"belong\" to the recipient or still available for preview by any recipient.\n    Shared notebooks that the recipient has joined (the username has already been\n    assigned to our user) are in the domain.  Additionally, shared notebooks\n    that allow preview and have not yet been joined are in the domain.\n  \n  NO_SHARED_NOTEBOOKS: No shared notebooks are applicable to the operation.\n  \"\"\"\n  ONLY_JOINED_OR_PREVIEW = 1\n  NO_SHARED_NOTEBOOKS = 2\n\n  _VALUES_TO_NAMES = {\n    1: \"ONLY_JOINED_OR_PREVIEW\",\n    2: \"NO_SHARED_NOTEBOOKS\",\n  }\n\n  _NAMES_TO_VALUES = {\n    \"ONLY_JOINED_OR_PREVIEW\": 1,\n    \"NO_SHARED_NOTEBOOKS\": 2,\n  }\n\nclass ReminderEmailConfig(object):\n  \"\"\"\n  An enumeration describing the configuration state related to receiving\n  reminder e-mails from the service.  Reminder e-mails summarize notes\n  based on their Note.attributes.reminderTime values.\n  \n  DO_NOT_SEND: The user has selected to not receive reminder e-mail.\n  \n  SEND_DAILY_EMAIL: The user has selected to receive reminder e-mail for those\n    days when there is a reminder.\n  \"\"\"\n  DO_NOT_SEND = 1\n  SEND_DAILY_EMAIL = 2\n\n  _VALUES_TO_NAMES = {\n    1: \"DO_NOT_SEND\",\n    2: \"SEND_DAILY_EMAIL\",\n  }\n\n  _NAMES_TO_VALUES = {\n    \"DO_NOT_SEND\": 1,\n    \"SEND_DAILY_EMAIL\": 2,\n  }\n\n\nclass Data(object):\n  \"\"\"\n   In several places, EDAM exchanges blocks of bytes of data for a component\n   which may be relatively large.  For example:  the contents of a clipped\n   HTML note, the bytes of an embedded image, or the recognition XML for\n   a large image.  This structure is used in the protocol to represent\n   any of those large blocks of data when they are transmitted or when\n   they are only referenced their metadata.\n  \n  <dl>\n   <dt>bodyHash</dt>\n     <dd>This field carries a one-way hash of the contents of the\n     data body, in binary form.  The hash function is MD5<br/>\n     Length:  EDAM_HASH_LEN (exactly)\n     </dd>\n  \n   <dt>size</dt>\n     <dd>The length, in bytes, of the data body.\n     </dd>\n  \n   <dt>body</dt>\n     <dd>This field is set to contain the binary contents of the data\n     whenever the resource is being transferred.  If only metadata is\n     being exchanged, this field will be empty.  For example, a client could\n     notify the service about the change to an attribute for a resource\n     without transmitting the binary resource contents.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - bodyHash\n   - size\n   - body\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'bodyHash', None, None, ), # 1\n    (2, TType.I32, 'size', None, None, ), # 2\n    (3, TType.STRING, 'body', None, None, ), # 3\n  )\n\n  def __init__(self, bodyHash=None, size=None, body=None,):\n    self.bodyHash = bodyHash\n    self.size = size\n    self.body = body\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.bodyHash = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I32:\n          self.size = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.body = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('Data')\n    if self.bodyHash is not None:\n      oprot.writeFieldBegin('bodyHash', TType.STRING, 1)\n      oprot.writeString(self.bodyHash)\n      oprot.writeFieldEnd()\n    if self.size is not None:\n      oprot.writeFieldBegin('size', TType.I32, 2)\n      oprot.writeI32(self.size)\n      oprot.writeFieldEnd()\n    if self.body is not None:\n      oprot.writeFieldBegin('body', TType.STRING, 3)\n      oprot.writeString(self.body)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass UserAttributes(object):\n  \"\"\"\n   A structure holding the optional attributes that can be stored\n   on a User.  These are generally less critical than the core User fields.\n  \n  <dl>\n   <dt>defaultLocationName</dt>\n     <dd>the location string that should be associated\n     with the user in order to determine where notes are taken if not otherwise\n     specified.<br/>\n     Length:  EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX\n     </dd>\n  \n   <dt>defaultLatitude</dt>\n     <dd>if set, this is the latitude that should be\n     assigned to any notes that have no other latitude information.\n     </dd>\n  \n   <dt>defaultLongitude</dt>\n     <dd>if set, this is the longitude that should be\n     assigned to any notes that have no other longitude information.\n     </dd>\n  \n   <dt>preactivation</dt>\n     <dd>if set, the user account is not yet confirmed for\n     login.  I.e. the account has been created, but we are still waiting for\n     the user to complete the activation step.\n     </dd>\n  \n   <dt>viewedPromotions</dt>\n     <dd>a list of promotions the user has seen.\n      This list may occasionally be modified by the system when promotions are\n      no longer available.<br/>\n      Length:  EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX\n     </dd>\n  \n   <dt>incomingEmailAddress</dt>\n     <dd>if set, this is the email address that the\n      user may send email to in order to add an email note directly into the\n      account via the SMTP email gateway.  This is the part of the email\n      address before the '@' symbol ... our domain is not included.\n      If this is not set, the user may not add notes via the gateway.<br/>\n      Length:  EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX\n     </dd>\n  \n   <dt>recentMailedAddresses</dt>\n     <dd>if set, this will contain a list of email\n      addresses that have recently been used as recipients\n      of outbound emails by the user.  This can be used to pre-populate a\n      list of possible destinations when a user wishes to send a note via\n      email.<br/>\n      Length:  EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX each<br/>\n      Max:  EDAM_USER_RECENT_MAILED_ADDRESSES_MAX entries\n     </dd>\n  \n   <dt>comments</dt>\n     <dd>Free-form text field that may hold general support\n      information, etc.<br/>\n      Length:  EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX\n     </dd>\n  \n   <dt>dateAgreedToTermsOfService</dt>\n     <dd>The date/time when the user agreed to\n      the terms of service.  This can be used as the effective \"start date\"\n      for the account.\n     </dd>\n  \n   <dt>maxReferrals</dt>\n     <dd>The number of referrals that the user is permitted\n      to make.\n     </dd>\n  \n   <dt>referralCount</dt>\n     <dd>The number of referrals sent from this account.\n     </dd>\n  \n   <dt>refererCode</dt>\n     <dd>A code indicating where the user was sent from. AKA\n      promotion code\n     </dd>\n  \n   <dt>sentEmailDate</dt>\n     <dd>The most recent date when the user sent outbound\n      emails from the service.  Used with sentEmailCount to limit the number\n      of emails that can be sent per day.\n     </dd>\n  \n   <dt>sentEmailCount</dt>\n     <dd>The number of emails that were sent from the user\n      via the service on sentEmailDate.  Used to enforce a limit on the number\n      of emails per user per day to prevent spamming.\n     </dd>\n  \n   <dt>dailyEmailLimit</dt>\n     <dd>If set, this is the maximum number of emails that\n      may be sent in a given day from this account.  If unset, the server will\n      use the configured default limit.\n     </dd>\n  \n   <dt>emailOptOutDate</dt>\n     <dd>If set, this is the date when the user asked\n      to be excluded from offers and promotions sent by Evernote.  If not set,\n      then the user currently agrees to receive these messages.\n     </dd>\n  \n   <dt>partnerEmailOptInDate</dt>\n     <dd>If set, this is the date when the user asked\n      to be included in offers and promotions sent by Evernote's partners.\n      If not sent, then the user currently does not agree to receive these\n      emails.\n     </dd>\n  \n   <dt>preferredLanguage</dt>\n     <dd>a 2 character language codes based on:\n         http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt used for\n        localization purposes to determine what language to use for the web\n        interface and for other direct communication (e.g. emails).\n     </dd>\n  \n   <dt>preferredCountry</dt>\n     <dd>Preferred country code based on ISO 3166-1-alpha-2 indicating the\n     users preferred country</dd>\n  \n   <dt>clipFullPage</dt>\n     <dd>Boolean flag set to true if the user wants to clip full pages by\n     default when they use the web clipper without a selection.</dd>\n  \n   <dt>twitterUserName</dt>\n     <dd>The username of the account of someone who has chosen to enable\n     Twittering into Evernote.  This value is subject to change, since users\n     may change their Twitter user name.</dd>\n  \n   <dt>twitterId</dt>\n     <dd>The unique identifier of the user's Twitter account if that user\n     has chosen to enable Twittering into Evernote.</dd>\n  \n   <dt>groupName</dt>\n     <dd>A name identifier used to identify a particular set of branding and\n      light customization.</dd>\n  \n   <dt>recognitionLanguage</dt>\n     <dd>a 2 character language codes based on:\n         http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt\n         If set, this is used to determine the language that should be used\n         when processing images and PDF files to find text.\n         If not set, then the 'preferredLanguage' will be used.\n     </dd>\n  \n   <dt>educationalInstitution</dt>\n     <dd>a flag indicating that the user is part of an educational institution which\n     makes them eligible for discounts on bulk purchases\n     </dd>\n  \n   <dt>businessAddress</dt>\n     <dd>A string recording the business address of a Sponsored Account user who has requested invoicing.\n     </dd>\n  \n   <dt>hideSponsorBilling</dt>\n     <dd>A flag indicating whether to hide the billing information on a sponsored\n         account owner's settings page\n     </dd>\n  \n   <dt>taxExempt</dt>\n     <dd>A flag indicating the user's sponsored group is exempt from sale tax\n     </dd>\n  \n   <dt>useEmailAutoFiling</dt>\n     <dd>A flag indicating whether the user chooses to allow Evernote to automatically\n         file and tag emailed notes\n     </dd>\n  \n   <dt>reminderEmailConfig</dt>\n     <dd>Configuration state for whether or not the user wishes to receive\n         reminder e-mail.  This setting applies to both the reminder e-mail sent\n         for personal reminder notes and for the reminder e-mail sent for reminder\n         notes in the user's business notebooks that the user has configured for\n         e-mail notifications.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - defaultLocationName\n   - defaultLatitude\n   - defaultLongitude\n   - preactivation\n   - viewedPromotions\n   - incomingEmailAddress\n   - recentMailedAddresses\n   - comments\n   - dateAgreedToTermsOfService\n   - maxReferrals\n   - referralCount\n   - refererCode\n   - sentEmailDate\n   - sentEmailCount\n   - dailyEmailLimit\n   - emailOptOutDate\n   - partnerEmailOptInDate\n   - preferredLanguage\n   - preferredCountry\n   - clipFullPage\n   - twitterUserName\n   - twitterId\n   - groupName\n   - recognitionLanguage\n   - referralProof\n   - educationalDiscount\n   - businessAddress\n   - hideSponsorBilling\n   - taxExempt\n   - useEmailAutoFiling\n   - reminderEmailConfig\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'defaultLocationName', None, None, ), # 1\n    (2, TType.DOUBLE, 'defaultLatitude', None, None, ), # 2\n    (3, TType.DOUBLE, 'defaultLongitude', None, None, ), # 3\n    (4, TType.BOOL, 'preactivation', None, None, ), # 4\n    (5, TType.LIST, 'viewedPromotions', (TType.STRING,None), None, ), # 5\n    (6, TType.STRING, 'incomingEmailAddress', None, None, ), # 6\n    (7, TType.LIST, 'recentMailedAddresses', (TType.STRING,None), None, ), # 7\n    None, # 8\n    (9, TType.STRING, 'comments', None, None, ), # 9\n    None, # 10\n    (11, TType.I64, 'dateAgreedToTermsOfService', None, None, ), # 11\n    (12, TType.I32, 'maxReferrals', None, None, ), # 12\n    (13, TType.I32, 'referralCount', None, None, ), # 13\n    (14, TType.STRING, 'refererCode', None, None, ), # 14\n    (15, TType.I64, 'sentEmailDate', None, None, ), # 15\n    (16, TType.I32, 'sentEmailCount', None, None, ), # 16\n    (17, TType.I32, 'dailyEmailLimit', None, None, ), # 17\n    (18, TType.I64, 'emailOptOutDate', None, None, ), # 18\n    (19, TType.I64, 'partnerEmailOptInDate', None, None, ), # 19\n    (20, TType.STRING, 'preferredLanguage', None, None, ), # 20\n    (21, TType.STRING, 'preferredCountry', None, None, ), # 21\n    (22, TType.BOOL, 'clipFullPage', None, None, ), # 22\n    (23, TType.STRING, 'twitterUserName', None, None, ), # 23\n    (24, TType.STRING, 'twitterId', None, None, ), # 24\n    (25, TType.STRING, 'groupName', None, None, ), # 25\n    (26, TType.STRING, 'recognitionLanguage', None, None, ), # 26\n    None, # 27\n    (28, TType.STRING, 'referralProof', None, None, ), # 28\n    (29, TType.BOOL, 'educationalDiscount', None, None, ), # 29\n    (30, TType.STRING, 'businessAddress', None, None, ), # 30\n    (31, TType.BOOL, 'hideSponsorBilling', None, None, ), # 31\n    (32, TType.BOOL, 'taxExempt', None, None, ), # 32\n    (33, TType.BOOL, 'useEmailAutoFiling', None, None, ), # 33\n    (34, TType.I32, 'reminderEmailConfig', None, None, ), # 34\n  )\n\n  def __init__(self, defaultLocationName=None, defaultLatitude=None, defaultLongitude=None, preactivation=None, viewedPromotions=None, incomingEmailAddress=None, recentMailedAddresses=None, comments=None, dateAgreedToTermsOfService=None, maxReferrals=None, referralCount=None, refererCode=None, sentEmailDate=None, sentEmailCount=None, dailyEmailLimit=None, emailOptOutDate=None, partnerEmailOptInDate=None, preferredLanguage=None, preferredCountry=None, clipFullPage=None, twitterUserName=None, twitterId=None, groupName=None, recognitionLanguage=None, referralProof=None, educationalDiscount=None, businessAddress=None, hideSponsorBilling=None, taxExempt=None, useEmailAutoFiling=None, reminderEmailConfig=None,):\n    self.defaultLocationName = defaultLocationName\n    self.defaultLatitude = defaultLatitude\n    self.defaultLongitude = defaultLongitude\n    self.preactivation = preactivation\n    self.viewedPromotions = viewedPromotions\n    self.incomingEmailAddress = incomingEmailAddress\n    self.recentMailedAddresses = recentMailedAddresses\n    self.comments = comments\n    self.dateAgreedToTermsOfService = dateAgreedToTermsOfService\n    self.maxReferrals = maxReferrals\n    self.referralCount = referralCount\n    self.refererCode = refererCode\n    self.sentEmailDate = sentEmailDate\n    self.sentEmailCount = sentEmailCount\n    self.dailyEmailLimit = dailyEmailLimit\n    self.emailOptOutDate = emailOptOutDate\n    self.partnerEmailOptInDate = partnerEmailOptInDate\n    self.preferredLanguage = preferredLanguage\n    self.preferredCountry = preferredCountry\n    self.clipFullPage = clipFullPage\n    self.twitterUserName = twitterUserName\n    self.twitterId = twitterId\n    self.groupName = groupName\n    self.recognitionLanguage = recognitionLanguage\n    self.referralProof = referralProof\n    self.educationalDiscount = educationalDiscount\n    self.businessAddress = businessAddress\n    self.hideSponsorBilling = hideSponsorBilling\n    self.taxExempt = taxExempt\n    self.useEmailAutoFiling = useEmailAutoFiling\n    self.reminderEmailConfig = reminderEmailConfig\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.defaultLocationName = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.DOUBLE:\n          self.defaultLatitude = iprot.readDouble();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.DOUBLE:\n          self.defaultLongitude = iprot.readDouble();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.BOOL:\n          self.preactivation = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.LIST:\n          self.viewedPromotions = []\n          (_etype3, _size0) = iprot.readListBegin()\n          for _i4 in xrange(_size0):\n            _elem5 = iprot.readString();\n            self.viewedPromotions.append(_elem5)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.STRING:\n          self.incomingEmailAddress = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.LIST:\n          self.recentMailedAddresses = []\n          (_etype9, _size6) = iprot.readListBegin()\n          for _i10 in xrange(_size6):\n            _elem11 = iprot.readString();\n            self.recentMailedAddresses.append(_elem11)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.STRING:\n          self.comments = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.I64:\n          self.dateAgreedToTermsOfService = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.I32:\n          self.maxReferrals = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 13:\n        if ftype == TType.I32:\n          self.referralCount = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 14:\n        if ftype == TType.STRING:\n          self.refererCode = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 15:\n        if ftype == TType.I64:\n          self.sentEmailDate = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 16:\n        if ftype == TType.I32:\n          self.sentEmailCount = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 17:\n        if ftype == TType.I32:\n          self.dailyEmailLimit = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 18:\n        if ftype == TType.I64:\n          self.emailOptOutDate = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 19:\n        if ftype == TType.I64:\n          self.partnerEmailOptInDate = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 20:\n        if ftype == TType.STRING:\n          self.preferredLanguage = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 21:\n        if ftype == TType.STRING:\n          self.preferredCountry = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 22:\n        if ftype == TType.BOOL:\n          self.clipFullPage = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 23:\n        if ftype == TType.STRING:\n          self.twitterUserName = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 24:\n        if ftype == TType.STRING:\n          self.twitterId = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 25:\n        if ftype == TType.STRING:\n          self.groupName = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 26:\n        if ftype == TType.STRING:\n          self.recognitionLanguage = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 28:\n        if ftype == TType.STRING:\n          self.referralProof = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 29:\n        if ftype == TType.BOOL:\n          self.educationalDiscount = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 30:\n        if ftype == TType.STRING:\n          self.businessAddress = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 31:\n        if ftype == TType.BOOL:\n          self.hideSponsorBilling = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 32:\n        if ftype == TType.BOOL:\n          self.taxExempt = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 33:\n        if ftype == TType.BOOL:\n          self.useEmailAutoFiling = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 34:\n        if ftype == TType.I32:\n          self.reminderEmailConfig = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('UserAttributes')\n    if self.defaultLocationName is not None:\n      oprot.writeFieldBegin('defaultLocationName', TType.STRING, 1)\n      oprot.writeString(self.defaultLocationName)\n      oprot.writeFieldEnd()\n    if self.defaultLatitude is not None:\n      oprot.writeFieldBegin('defaultLatitude', TType.DOUBLE, 2)\n      oprot.writeDouble(self.defaultLatitude)\n      oprot.writeFieldEnd()\n    if self.defaultLongitude is not None:\n      oprot.writeFieldBegin('defaultLongitude', TType.DOUBLE, 3)\n      oprot.writeDouble(self.defaultLongitude)\n      oprot.writeFieldEnd()\n    if self.preactivation is not None:\n      oprot.writeFieldBegin('preactivation', TType.BOOL, 4)\n      oprot.writeBool(self.preactivation)\n      oprot.writeFieldEnd()\n    if self.viewedPromotions is not None:\n      oprot.writeFieldBegin('viewedPromotions', TType.LIST, 5)\n      oprot.writeListBegin(TType.STRING, len(self.viewedPromotions))\n      for iter12 in self.viewedPromotions:\n        oprot.writeString(iter12)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.incomingEmailAddress is not None:\n      oprot.writeFieldBegin('incomingEmailAddress', TType.STRING, 6)\n      oprot.writeString(self.incomingEmailAddress)\n      oprot.writeFieldEnd()\n    if self.recentMailedAddresses is not None:\n      oprot.writeFieldBegin('recentMailedAddresses', TType.LIST, 7)\n      oprot.writeListBegin(TType.STRING, len(self.recentMailedAddresses))\n      for iter13 in self.recentMailedAddresses:\n        oprot.writeString(iter13)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.comments is not None:\n      oprot.writeFieldBegin('comments', TType.STRING, 9)\n      oprot.writeString(self.comments)\n      oprot.writeFieldEnd()\n    if self.dateAgreedToTermsOfService is not None:\n      oprot.writeFieldBegin('dateAgreedToTermsOfService', TType.I64, 11)\n      oprot.writeI64(self.dateAgreedToTermsOfService)\n      oprot.writeFieldEnd()\n    if self.maxReferrals is not None:\n      oprot.writeFieldBegin('maxReferrals', TType.I32, 12)\n      oprot.writeI32(self.maxReferrals)\n      oprot.writeFieldEnd()\n    if self.referralCount is not None:\n      oprot.writeFieldBegin('referralCount', TType.I32, 13)\n      oprot.writeI32(self.referralCount)\n      oprot.writeFieldEnd()\n    if self.refererCode is not None:\n      oprot.writeFieldBegin('refererCode', TType.STRING, 14)\n      oprot.writeString(self.refererCode)\n      oprot.writeFieldEnd()\n    if self.sentEmailDate is not None:\n      oprot.writeFieldBegin('sentEmailDate', TType.I64, 15)\n      oprot.writeI64(self.sentEmailDate)\n      oprot.writeFieldEnd()\n    if self.sentEmailCount is not None:\n      oprot.writeFieldBegin('sentEmailCount', TType.I32, 16)\n      oprot.writeI32(self.sentEmailCount)\n      oprot.writeFieldEnd()\n    if self.dailyEmailLimit is not None:\n      oprot.writeFieldBegin('dailyEmailLimit', TType.I32, 17)\n      oprot.writeI32(self.dailyEmailLimit)\n      oprot.writeFieldEnd()\n    if self.emailOptOutDate is not None:\n      oprot.writeFieldBegin('emailOptOutDate', TType.I64, 18)\n      oprot.writeI64(self.emailOptOutDate)\n      oprot.writeFieldEnd()\n    if self.partnerEmailOptInDate is not None:\n      oprot.writeFieldBegin('partnerEmailOptInDate', TType.I64, 19)\n      oprot.writeI64(self.partnerEmailOptInDate)\n      oprot.writeFieldEnd()\n    if self.preferredLanguage is not None:\n      oprot.writeFieldBegin('preferredLanguage', TType.STRING, 20)\n      oprot.writeString(self.preferredLanguage)\n      oprot.writeFieldEnd()\n    if self.preferredCountry is not None:\n      oprot.writeFieldBegin('preferredCountry', TType.STRING, 21)\n      oprot.writeString(self.preferredCountry)\n      oprot.writeFieldEnd()\n    if self.clipFullPage is not None:\n      oprot.writeFieldBegin('clipFullPage', TType.BOOL, 22)\n      oprot.writeBool(self.clipFullPage)\n      oprot.writeFieldEnd()\n    if self.twitterUserName is not None:\n      oprot.writeFieldBegin('twitterUserName', TType.STRING, 23)\n      oprot.writeString(self.twitterUserName)\n      oprot.writeFieldEnd()\n    if self.twitterId is not None:\n      oprot.writeFieldBegin('twitterId', TType.STRING, 24)\n      oprot.writeString(self.twitterId)\n      oprot.writeFieldEnd()\n    if self.groupName is not None:\n      oprot.writeFieldBegin('groupName', TType.STRING, 25)\n      oprot.writeString(self.groupName)\n      oprot.writeFieldEnd()\n    if self.recognitionLanguage is not None:\n      oprot.writeFieldBegin('recognitionLanguage', TType.STRING, 26)\n      oprot.writeString(self.recognitionLanguage)\n      oprot.writeFieldEnd()\n    if self.referralProof is not None:\n      oprot.writeFieldBegin('referralProof', TType.STRING, 28)\n      oprot.writeString(self.referralProof)\n      oprot.writeFieldEnd()\n    if self.educationalDiscount is not None:\n      oprot.writeFieldBegin('educationalDiscount', TType.BOOL, 29)\n      oprot.writeBool(self.educationalDiscount)\n      oprot.writeFieldEnd()\n    if self.businessAddress is not None:\n      oprot.writeFieldBegin('businessAddress', TType.STRING, 30)\n      oprot.writeString(self.businessAddress)\n      oprot.writeFieldEnd()\n    if self.hideSponsorBilling is not None:\n      oprot.writeFieldBegin('hideSponsorBilling', TType.BOOL, 31)\n      oprot.writeBool(self.hideSponsorBilling)\n      oprot.writeFieldEnd()\n    if self.taxExempt is not None:\n      oprot.writeFieldBegin('taxExempt', TType.BOOL, 32)\n      oprot.writeBool(self.taxExempt)\n      oprot.writeFieldEnd()\n    if self.useEmailAutoFiling is not None:\n      oprot.writeFieldBegin('useEmailAutoFiling', TType.BOOL, 33)\n      oprot.writeBool(self.useEmailAutoFiling)\n      oprot.writeFieldEnd()\n    if self.reminderEmailConfig is not None:\n      oprot.writeFieldBegin('reminderEmailConfig', TType.I32, 34)\n      oprot.writeI32(self.reminderEmailConfig)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass Accounting(object):\n  \"\"\"\n   This represents the bookkeeping information for the user's subscription.\n  \n  <dl>\n   <dt>uploadLimit</dt>\n     <dd>The number of bytes that can be uploaded to the account\n     in the current month.  For new notes that are created, this is the length\n     of the note content (in Unicode characters) plus the size of each resource\n     (in bytes).  For edited notes, this is the the difference between the old\n     length and the new length (if this is greater than 0) plus the size of\n     each new resource.\n     </dd>\n   <dt>uploadLimitEnd</dt>\n     <dd>The date and time when the current upload limit\n     expires.  At this time, the monthly upload count reverts to 0 and a new\n     limit is imposed.  This date and time is exclusive, so this is effectively\n     the start of the new month.\n     </dd>\n   <dt>uploadLimitNextMonth</dt>\n     <dd> When uploadLimitEnd is reached, the service\n     will change uploadLimit to uploadLimitNextMonth. If a premium account is\n     canceled, this mechanism will reset the quota appropriately.\n     </dd>\n   <dt>premiumServiceStatus</dt>\n     <dd>Indicates the phases of a premium account\n     during the billing process.\n     </dd>\n   <dt>premiumOrderNumber</dt>\n     <dd>The order number used by the commerce system to\n     process recurring payments\n     </dd>\n   <dt>premiumServiceStart</dt>\n     <dd>The start date when this premium promotion\n     began (this number will get overwritten if a premium service is canceled\n     and then re-activated).\n     </dd>\n   <dt>premiumCommerceService</dt>\n     <dd>The commerce system used (paypal, Google\n     checkout, etc)\n     </dd>\n   <dt>premiumServiceSKU</dt>\n     <dd>The code associated with the purchase eg. monthly\n     or annual purchase. Clients should interpret this value and localize it.\n     </dd>\n   <dt>lastSuccessfulCharge</dt>\n     <dd>Date the last time the user was charged.\n     Null if never charged.\n     </dd>\n   <dt>lastFailedCharge</dt>\n     <dd>Date the last time a charge was attempted and\n     failed.\n     </dd>\n   <dt>lastFailedChargeReason</dt>\n     <dd>Reason provided for the charge failure\n     </dd>\n   <dt>nextPaymentDue</dt>\n     <dd>The end of the billing cycle. This could be in the\n     past if there are failed charges.\n     </dd>\n   <dt>premiumLockUntil</dt>\n     <dd>An internal variable to manage locking operations\n     on the commerce variables.\n     </dd>\n   <dt>updated</dt>\n     <dd>The date any modification where made to this record.\n     </dd>\n   <dt>premiumSubscriptionNumber</dt>\n     <dd>The number number identifying the\n     recurring subscription used to make the recurring charges.\n     </dd>\n   <dt>lastRequestedCharge</dt>\n     <dd>Date charge last attempted</dd>\n   <dt>currency</dt>\n     <dd>ISO 4217 currency code</dd>\n   <dt>unitPrice</dt>\n     <dd>charge in the smallest unit of the currency (e.g. cents for USD)</dd>\n   <dt>businessId</dt>\n     <dd><i>DEPRECATED:</i>See BusinessUserInfo.</dd>\n   <dt>businessName</dt>\n     <dd><i>DEPRECATED:</i>See BusinessUserInfo.</dd>\n   <dt>businessRole</dt>\n     <dd><i>DEPRECATED:</i>See BusinessUserInfo.</dd>\n   <dt>unitDiscount</dt>\n     <dd>discount per seat in negative amount and smallest unit of the currency (e.g. cents for USD)</dd>\n   <dt>nextChargeDate</dt>\n     <dd>The next time the user will be charged, may or may not be the same as nextPaymentDue</dd>\n   </dl>\n  \n  Attributes:\n   - uploadLimit\n   - uploadLimitEnd\n   - uploadLimitNextMonth\n   - premiumServiceStatus\n   - premiumOrderNumber\n   - premiumCommerceService\n   - premiumServiceStart\n   - premiumServiceSKU\n   - lastSuccessfulCharge\n   - lastFailedCharge\n   - lastFailedChargeReason\n   - nextPaymentDue\n   - premiumLockUntil\n   - updated\n   - premiumSubscriptionNumber\n   - lastRequestedCharge\n   - currency\n   - unitPrice\n   - businessId\n   - businessName\n   - businessRole\n   - unitDiscount\n   - nextChargeDate\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I64, 'uploadLimit', None, None, ), # 1\n    (2, TType.I64, 'uploadLimitEnd', None, None, ), # 2\n    (3, TType.I64, 'uploadLimitNextMonth', None, None, ), # 3\n    (4, TType.I32, 'premiumServiceStatus', None, None, ), # 4\n    (5, TType.STRING, 'premiumOrderNumber', None, None, ), # 5\n    (6, TType.STRING, 'premiumCommerceService', None, None, ), # 6\n    (7, TType.I64, 'premiumServiceStart', None, None, ), # 7\n    (8, TType.STRING, 'premiumServiceSKU', None, None, ), # 8\n    (9, TType.I64, 'lastSuccessfulCharge', None, None, ), # 9\n    (10, TType.I64, 'lastFailedCharge', None, None, ), # 10\n    (11, TType.STRING, 'lastFailedChargeReason', None, None, ), # 11\n    (12, TType.I64, 'nextPaymentDue', None, None, ), # 12\n    (13, TType.I64, 'premiumLockUntil', None, None, ), # 13\n    (14, TType.I64, 'updated', None, None, ), # 14\n    None, # 15\n    (16, TType.STRING, 'premiumSubscriptionNumber', None, None, ), # 16\n    (17, TType.I64, 'lastRequestedCharge', None, None, ), # 17\n    (18, TType.STRING, 'currency', None, None, ), # 18\n    (19, TType.I32, 'unitPrice', None, None, ), # 19\n    (20, TType.I32, 'businessId', None, None, ), # 20\n    (21, TType.STRING, 'businessName', None, None, ), # 21\n    (22, TType.I32, 'businessRole', None, None, ), # 22\n    (23, TType.I32, 'unitDiscount', None, None, ), # 23\n    (24, TType.I64, 'nextChargeDate', None, None, ), # 24\n  )\n\n  def __init__(self, uploadLimit=None, uploadLimitEnd=None, uploadLimitNextMonth=None, premiumServiceStatus=None, premiumOrderNumber=None, premiumCommerceService=None, premiumServiceStart=None, premiumServiceSKU=None, lastSuccessfulCharge=None, lastFailedCharge=None, lastFailedChargeReason=None, nextPaymentDue=None, premiumLockUntil=None, updated=None, premiumSubscriptionNumber=None, lastRequestedCharge=None, currency=None, unitPrice=None, businessId=None, businessName=None, businessRole=None, unitDiscount=None, nextChargeDate=None,):\n    self.uploadLimit = uploadLimit\n    self.uploadLimitEnd = uploadLimitEnd\n    self.uploadLimitNextMonth = uploadLimitNextMonth\n    self.premiumServiceStatus = premiumServiceStatus\n    self.premiumOrderNumber = premiumOrderNumber\n    self.premiumCommerceService = premiumCommerceService\n    self.premiumServiceStart = premiumServiceStart\n    self.premiumServiceSKU = premiumServiceSKU\n    self.lastSuccessfulCharge = lastSuccessfulCharge\n    self.lastFailedCharge = lastFailedCharge\n    self.lastFailedChargeReason = lastFailedChargeReason\n    self.nextPaymentDue = nextPaymentDue\n    self.premiumLockUntil = premiumLockUntil\n    self.updated = updated\n    self.premiumSubscriptionNumber = premiumSubscriptionNumber\n    self.lastRequestedCharge = lastRequestedCharge\n    self.currency = currency\n    self.unitPrice = unitPrice\n    self.businessId = businessId\n    self.businessName = businessName\n    self.businessRole = businessRole\n    self.unitDiscount = unitDiscount\n    self.nextChargeDate = nextChargeDate\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I64:\n          self.uploadLimit = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I64:\n          self.uploadLimitEnd = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I64:\n          self.uploadLimitNextMonth = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.I32:\n          self.premiumServiceStatus = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.STRING:\n          self.premiumOrderNumber = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.STRING:\n          self.premiumCommerceService = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.I64:\n          self.premiumServiceStart = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.STRING:\n          self.premiumServiceSKU = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.I64:\n          self.lastSuccessfulCharge = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.I64:\n          self.lastFailedCharge = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.STRING:\n          self.lastFailedChargeReason = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.I64:\n          self.nextPaymentDue = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 13:\n        if ftype == TType.I64:\n          self.premiumLockUntil = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 14:\n        if ftype == TType.I64:\n          self.updated = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 16:\n        if ftype == TType.STRING:\n          self.premiumSubscriptionNumber = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 17:\n        if ftype == TType.I64:\n          self.lastRequestedCharge = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 18:\n        if ftype == TType.STRING:\n          self.currency = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 19:\n        if ftype == TType.I32:\n          self.unitPrice = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 20:\n        if ftype == TType.I32:\n          self.businessId = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 21:\n        if ftype == TType.STRING:\n          self.businessName = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 22:\n        if ftype == TType.I32:\n          self.businessRole = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 23:\n        if ftype == TType.I32:\n          self.unitDiscount = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 24:\n        if ftype == TType.I64:\n          self.nextChargeDate = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('Accounting')\n    if self.uploadLimit is not None:\n      oprot.writeFieldBegin('uploadLimit', TType.I64, 1)\n      oprot.writeI64(self.uploadLimit)\n      oprot.writeFieldEnd()\n    if self.uploadLimitEnd is not None:\n      oprot.writeFieldBegin('uploadLimitEnd', TType.I64, 2)\n      oprot.writeI64(self.uploadLimitEnd)\n      oprot.writeFieldEnd()\n    if self.uploadLimitNextMonth is not None:\n      oprot.writeFieldBegin('uploadLimitNextMonth', TType.I64, 3)\n      oprot.writeI64(self.uploadLimitNextMonth)\n      oprot.writeFieldEnd()\n    if self.premiumServiceStatus is not None:\n      oprot.writeFieldBegin('premiumServiceStatus', TType.I32, 4)\n      oprot.writeI32(self.premiumServiceStatus)\n      oprot.writeFieldEnd()\n    if self.premiumOrderNumber is not None:\n      oprot.writeFieldBegin('premiumOrderNumber', TType.STRING, 5)\n      oprot.writeString(self.premiumOrderNumber)\n      oprot.writeFieldEnd()\n    if self.premiumCommerceService is not None:\n      oprot.writeFieldBegin('premiumCommerceService', TType.STRING, 6)\n      oprot.writeString(self.premiumCommerceService)\n      oprot.writeFieldEnd()\n    if self.premiumServiceStart is not None:\n      oprot.writeFieldBegin('premiumServiceStart', TType.I64, 7)\n      oprot.writeI64(self.premiumServiceStart)\n      oprot.writeFieldEnd()\n    if self.premiumServiceSKU is not None:\n      oprot.writeFieldBegin('premiumServiceSKU', TType.STRING, 8)\n      oprot.writeString(self.premiumServiceSKU)\n      oprot.writeFieldEnd()\n    if self.lastSuccessfulCharge is not None:\n      oprot.writeFieldBegin('lastSuccessfulCharge', TType.I64, 9)\n      oprot.writeI64(self.lastSuccessfulCharge)\n      oprot.writeFieldEnd()\n    if self.lastFailedCharge is not None:\n      oprot.writeFieldBegin('lastFailedCharge', TType.I64, 10)\n      oprot.writeI64(self.lastFailedCharge)\n      oprot.writeFieldEnd()\n    if self.lastFailedChargeReason is not None:\n      oprot.writeFieldBegin('lastFailedChargeReason', TType.STRING, 11)\n      oprot.writeString(self.lastFailedChargeReason)\n      oprot.writeFieldEnd()\n    if self.nextPaymentDue is not None:\n      oprot.writeFieldBegin('nextPaymentDue', TType.I64, 12)\n      oprot.writeI64(self.nextPaymentDue)\n      oprot.writeFieldEnd()\n    if self.premiumLockUntil is not None:\n      oprot.writeFieldBegin('premiumLockUntil', TType.I64, 13)\n      oprot.writeI64(self.premiumLockUntil)\n      oprot.writeFieldEnd()\n    if self.updated is not None:\n      oprot.writeFieldBegin('updated', TType.I64, 14)\n      oprot.writeI64(self.updated)\n      oprot.writeFieldEnd()\n    if self.premiumSubscriptionNumber is not None:\n      oprot.writeFieldBegin('premiumSubscriptionNumber', TType.STRING, 16)\n      oprot.writeString(self.premiumSubscriptionNumber)\n      oprot.writeFieldEnd()\n    if self.lastRequestedCharge is not None:\n      oprot.writeFieldBegin('lastRequestedCharge', TType.I64, 17)\n      oprot.writeI64(self.lastRequestedCharge)\n      oprot.writeFieldEnd()\n    if self.currency is not None:\n      oprot.writeFieldBegin('currency', TType.STRING, 18)\n      oprot.writeString(self.currency)\n      oprot.writeFieldEnd()\n    if self.unitPrice is not None:\n      oprot.writeFieldBegin('unitPrice', TType.I32, 19)\n      oprot.writeI32(self.unitPrice)\n      oprot.writeFieldEnd()\n    if self.businessId is not None:\n      oprot.writeFieldBegin('businessId', TType.I32, 20)\n      oprot.writeI32(self.businessId)\n      oprot.writeFieldEnd()\n    if self.businessName is not None:\n      oprot.writeFieldBegin('businessName', TType.STRING, 21)\n      oprot.writeString(self.businessName)\n      oprot.writeFieldEnd()\n    if self.businessRole is not None:\n      oprot.writeFieldBegin('businessRole', TType.I32, 22)\n      oprot.writeI32(self.businessRole)\n      oprot.writeFieldEnd()\n    if self.unitDiscount is not None:\n      oprot.writeFieldBegin('unitDiscount', TType.I32, 23)\n      oprot.writeI32(self.unitDiscount)\n      oprot.writeFieldEnd()\n    if self.nextChargeDate is not None:\n      oprot.writeFieldBegin('nextChargeDate', TType.I64, 24)\n      oprot.writeI64(self.nextChargeDate)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass BusinessUserInfo(object):\n  \"\"\"\n  This structure is used to provide information about an Evernote Business\n  membership, for members who are part of a business.\n  \n  <dl>\n  <dt>businessId</dt>\n    <dd>The ID of the Evernote Business account that the user is a member of.\n  <dt>businessName</dt>\n    <dd>The human-readable name of the Evernote Business account that the user\n        is a member of.</dd>\n  <dt>role</dt>\n    <dd>The role of the user within the Evernote Business account that\n        they are a member of.</dd>\n  <dt>email</dt>\n    <dd>An e-mail address that will be used by the service in the context of your\n        Evernote Business activities.  For example, this e-mail address will be used\n        when you e-mail a business note, when you update notes in the account of\n        your business, etc.  The business e-mail cannot be used for identification\n        purposes such as for logging into the service.\n    </dd>\n  </dl>\n  \n  Attributes:\n   - businessId\n   - businessName\n   - role\n   - email\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I32, 'businessId', None, None, ), # 1\n    (2, TType.STRING, 'businessName', None, None, ), # 2\n    (3, TType.I32, 'role', None, None, ), # 3\n    (4, TType.STRING, 'email', None, None, ), # 4\n  )\n\n  def __init__(self, businessId=None, businessName=None, role=None, email=None,):\n    self.businessId = businessId\n    self.businessName = businessName\n    self.role = role\n    self.email = email\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I32:\n          self.businessId = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.businessName = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.role = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.email = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('BusinessUserInfo')\n    if self.businessId is not None:\n      oprot.writeFieldBegin('businessId', TType.I32, 1)\n      oprot.writeI32(self.businessId)\n      oprot.writeFieldEnd()\n    if self.businessName is not None:\n      oprot.writeFieldBegin('businessName', TType.STRING, 2)\n      oprot.writeString(self.businessName)\n      oprot.writeFieldEnd()\n    if self.role is not None:\n      oprot.writeFieldBegin('role', TType.I32, 3)\n      oprot.writeI32(self.role)\n      oprot.writeFieldEnd()\n    if self.email is not None:\n      oprot.writeFieldBegin('email', TType.STRING, 4)\n      oprot.writeString(self.email)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass PremiumInfo(object):\n  \"\"\"\n   This structure is used to provide information about a user's Premium account.\n  <dl>\n   <dt>currentTime</dt>\n     <dd>\n     The server-side date and time when this data was generated.\n     </dd>\n   <dt>premium</dt>\n     <dd>\n     True if the user's account is Premium.\n     </dd>\n   <dt>premiumRecurring</dt>\n     <dd>\n     True if the user's account is Premium and has a recurring payment method.\n     </dd>\n   <dt>premiumExpirationDate</dt>\n     <dd>\n     The date when the user's Premium account expires, or the date when the\n     user's account is due for payment if it has a recurring payment method.\n     </dd>\n   <dt>premiumExtendable</dt>\n     <dd>\n     True if the user is eligible for purchasing Premium account extensions.\n     </dd>\n   <dt>premiumPending</dt>\n     <dd>\n     True if the user's Premium account is pending payment confirmation\n     </dd>\n   <dt>premiumCancellationPending</dt>\n     <dd>\n     True if the user has requested that no further charges to be made; the\n     Premium account will remain active until it expires.\n     </dd>\n   <dt>canPurchaseUploadAllowance</dt>\n     <dd>\n     True if the user is eligible for purchasing additional upload allowance.\n     </dd>\n   <dt>sponsoredGroupName</dt>\n     <dd>\n     The name of the sponsored group that the user is part of.\n     </dd>\n   <dt>sponsoredGroupRole</dt>\n     <dd>\n     DEPRECATED - will be removed in a future update.\n     </dd>\n   <dt>premiumUpgradable</dt>\n     <dd>\n     True if the user is eligible for purchasing Premium account upgrade.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - currentTime\n   - premium\n   - premiumRecurring\n   - premiumExpirationDate\n   - premiumExtendable\n   - premiumPending\n   - premiumCancellationPending\n   - canPurchaseUploadAllowance\n   - sponsoredGroupName\n   - sponsoredGroupRole\n   - premiumUpgradable\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I64, 'currentTime', None, None, ), # 1\n    (2, TType.BOOL, 'premium', None, None, ), # 2\n    (3, TType.BOOL, 'premiumRecurring', None, None, ), # 3\n    (4, TType.I64, 'premiumExpirationDate', None, None, ), # 4\n    (5, TType.BOOL, 'premiumExtendable', None, None, ), # 5\n    (6, TType.BOOL, 'premiumPending', None, None, ), # 6\n    (7, TType.BOOL, 'premiumCancellationPending', None, None, ), # 7\n    (8, TType.BOOL, 'canPurchaseUploadAllowance', None, None, ), # 8\n    (9, TType.STRING, 'sponsoredGroupName', None, None, ), # 9\n    (10, TType.I32, 'sponsoredGroupRole', None, None, ), # 10\n    (11, TType.BOOL, 'premiumUpgradable', None, None, ), # 11\n  )\n\n  def __init__(self, currentTime=None, premium=None, premiumRecurring=None, premiumExpirationDate=None, premiumExtendable=None, premiumPending=None, premiumCancellationPending=None, canPurchaseUploadAllowance=None, sponsoredGroupName=None, sponsoredGroupRole=None, premiumUpgradable=None,):\n    self.currentTime = currentTime\n    self.premium = premium\n    self.premiumRecurring = premiumRecurring\n    self.premiumExpirationDate = premiumExpirationDate\n    self.premiumExtendable = premiumExtendable\n    self.premiumPending = premiumPending\n    self.premiumCancellationPending = premiumCancellationPending\n    self.canPurchaseUploadAllowance = canPurchaseUploadAllowance\n    self.sponsoredGroupName = sponsoredGroupName\n    self.sponsoredGroupRole = sponsoredGroupRole\n    self.premiumUpgradable = premiumUpgradable\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I64:\n          self.currentTime = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.BOOL:\n          self.premium = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.BOOL:\n          self.premiumRecurring = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.I64:\n          self.premiumExpirationDate = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.premiumExtendable = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.BOOL:\n          self.premiumPending = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.BOOL:\n          self.premiumCancellationPending = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.BOOL:\n          self.canPurchaseUploadAllowance = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.STRING:\n          self.sponsoredGroupName = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.I32:\n          self.sponsoredGroupRole = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.BOOL:\n          self.premiumUpgradable = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('PremiumInfo')\n    if self.currentTime is not None:\n      oprot.writeFieldBegin('currentTime', TType.I64, 1)\n      oprot.writeI64(self.currentTime)\n      oprot.writeFieldEnd()\n    if self.premium is not None:\n      oprot.writeFieldBegin('premium', TType.BOOL, 2)\n      oprot.writeBool(self.premium)\n      oprot.writeFieldEnd()\n    if self.premiumRecurring is not None:\n      oprot.writeFieldBegin('premiumRecurring', TType.BOOL, 3)\n      oprot.writeBool(self.premiumRecurring)\n      oprot.writeFieldEnd()\n    if self.premiumExpirationDate is not None:\n      oprot.writeFieldBegin('premiumExpirationDate', TType.I64, 4)\n      oprot.writeI64(self.premiumExpirationDate)\n      oprot.writeFieldEnd()\n    if self.premiumExtendable is not None:\n      oprot.writeFieldBegin('premiumExtendable', TType.BOOL, 5)\n      oprot.writeBool(self.premiumExtendable)\n      oprot.writeFieldEnd()\n    if self.premiumPending is not None:\n      oprot.writeFieldBegin('premiumPending', TType.BOOL, 6)\n      oprot.writeBool(self.premiumPending)\n      oprot.writeFieldEnd()\n    if self.premiumCancellationPending is not None:\n      oprot.writeFieldBegin('premiumCancellationPending', TType.BOOL, 7)\n      oprot.writeBool(self.premiumCancellationPending)\n      oprot.writeFieldEnd()\n    if self.canPurchaseUploadAllowance is not None:\n      oprot.writeFieldBegin('canPurchaseUploadAllowance', TType.BOOL, 8)\n      oprot.writeBool(self.canPurchaseUploadAllowance)\n      oprot.writeFieldEnd()\n    if self.sponsoredGroupName is not None:\n      oprot.writeFieldBegin('sponsoredGroupName', TType.STRING, 9)\n      oprot.writeString(self.sponsoredGroupName)\n      oprot.writeFieldEnd()\n    if self.sponsoredGroupRole is not None:\n      oprot.writeFieldBegin('sponsoredGroupRole', TType.I32, 10)\n      oprot.writeI32(self.sponsoredGroupRole)\n      oprot.writeFieldEnd()\n    if self.premiumUpgradable is not None:\n      oprot.writeFieldBegin('premiumUpgradable', TType.BOOL, 11)\n      oprot.writeBool(self.premiumUpgradable)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.currentTime is None:\n      raise TProtocol.TProtocolException(message='Required field currentTime is unset!')\n    if self.premium is None:\n      raise TProtocol.TProtocolException(message='Required field premium is unset!')\n    if self.premiumRecurring is None:\n      raise TProtocol.TProtocolException(message='Required field premiumRecurring is unset!')\n    if self.premiumExtendable is None:\n      raise TProtocol.TProtocolException(message='Required field premiumExtendable is unset!')\n    if self.premiumPending is None:\n      raise TProtocol.TProtocolException(message='Required field premiumPending is unset!')\n    if self.premiumCancellationPending is None:\n      raise TProtocol.TProtocolException(message='Required field premiumCancellationPending is unset!')\n    if self.canPurchaseUploadAllowance is None:\n      raise TProtocol.TProtocolException(message='Required field canPurchaseUploadAllowance is unset!')\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass User(object):\n  \"\"\"\n   This represents the information about a single user account.\n  <dl>\n   <dt>id</dt>\n     <dd>The unique numeric identifier for the account, which will not\n     change for the lifetime of the account.\n     </dd>\n  \n   <dt>username</dt>\n     <dd>The name that uniquely identifies a single user account. This name\n     may be presented by the user, along with their password, to log into\n     their account.\n     May only contain a-z, 0-9, or '-', and may not start or end with the '-'\n     <br/>\n     Length:  EDAM_USER_USERNAME_LEN_MIN - EDAM_USER_USERNAME_LEN_MAX\n     <br/>\n     Regex:  EDAM_USER_USERNAME_REGEX\n     </dd>\n  \n   <dt>email</dt>\n     <dd>The email address registered for the user.  Must comply with\n     RFC 2821 and RFC 2822.<br/>\n     Third party applications that authenticate using OAuth do not have\n     access to this field.\n     Length:  EDAM_EMAIL_LEN_MIN - EDAM_EMAIL_LEN_MAX\n     <br/>\n     Regex:  EDAM_EMAIL_REGEX\n     </dd>\n  \n   <dt>name</dt>\n     <dd>The printable name of the user, which may be a combination\n     of given and family names.  This is used instead of separate \"first\"\n     and \"last\" names due to variations in international name format/order.\n     May not start or end with a whitespace character.  May contain any\n     character but carriage return or newline (Unicode classes Zl and Zp).\n     <br/>\n     Length:  EDAM_USER_NAME_LEN_MIN - EDAM_USER_NAME_LEN_MAX\n     <br/>\n     Regex:  EDAM_USER_NAME_REGEX\n     </dd>\n  \n   <dt>timezone</dt>\n     <dd>The zone ID for the user's default location.  If present,\n     this may be used to localize the display of any timestamp for which no\n     other timezone is available.\n     The format must be encoded as a standard zone ID such as\n     \"America/Los_Angeles\" or \"GMT+08:00\"\n     <br/>\n     Length:  EDAM_TIMEZONE_LEN_MIN - EDAM_TIMEZONE_LEN_MAX\n     <br/>\n     Regex:  EDAM_TIMEZONE_REGEX\n     </dd>\n  \n   <dt>privilege</dt>\n     <dd>The level of access permitted for the user.\n     </dd>\n  \n   <dt>created</dt>\n     <dd>The date and time when this user account was created in the\n     service.\n     </dd>\n  \n   <dt>updated</dt>\n     <dd>The date and time when this user account was last modified\n     in the service.\n     </dd>\n  \n   <dt>deleted</dt>\n     <dd>If the account has been deleted from the system (e.g. as\n     the result of a legal request by the user), the date and time of the\n     deletion will be represented here.  If not, this value will not be set.\n     </dd>\n  \n   <dt>active</dt>\n     <dd>If the user account is available for login and\n     synchronization, this flag will be set to true.\n     </dd>\n  \n   <dt>shardId</dt>\n     <dd>DEPRECATED - Client applications should have no need to use this field.\n     </dd>\n  \n   <dt>attributes</dt>\n     <dd>If present, this will contain a list of the attributes\n     for this user account.\n     </dd>\n  \n   <dt>accounting</dt>\n     <dd>Bookkeeping information for the user's subscription.\n     </dd>\n  \n   <dt>premiumInfo</dt>\n     <dd>If present, this will contain a set of commerce information\n     relating to the user's premium service level.\n     </dd>\n  \n   <dt>businessUserInfo</dt>\n     <dd>If present, this will contain a set of business information\n     relating to the user's business membership.  If not present, the\n     user is not currently part of a business.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - id\n   - username\n   - email\n   - name\n   - timezone\n   - privilege\n   - created\n   - updated\n   - deleted\n   - active\n   - shardId\n   - attributes\n   - accounting\n   - premiumInfo\n   - businessUserInfo\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I32, 'id', None, None, ), # 1\n    (2, TType.STRING, 'username', None, None, ), # 2\n    (3, TType.STRING, 'email', None, None, ), # 3\n    (4, TType.STRING, 'name', None, None, ), # 4\n    None, # 5\n    (6, TType.STRING, 'timezone', None, None, ), # 6\n    (7, TType.I32, 'privilege', None, None, ), # 7\n    None, # 8\n    (9, TType.I64, 'created', None, None, ), # 9\n    (10, TType.I64, 'updated', None, None, ), # 10\n    (11, TType.I64, 'deleted', None, None, ), # 11\n    None, # 12\n    (13, TType.BOOL, 'active', None, None, ), # 13\n    (14, TType.STRING, 'shardId', None, None, ), # 14\n    (15, TType.STRUCT, 'attributes', (UserAttributes, UserAttributes.thrift_spec), None, ), # 15\n    (16, TType.STRUCT, 'accounting', (Accounting, Accounting.thrift_spec), None, ), # 16\n    (17, TType.STRUCT, 'premiumInfo', (PremiumInfo, PremiumInfo.thrift_spec), None, ), # 17\n    (18, TType.STRUCT, 'businessUserInfo', (BusinessUserInfo, BusinessUserInfo.thrift_spec), None, ), # 18\n  )\n\n  def __init__(self, id=None, username=None, email=None, name=None, timezone=None, privilege=None, created=None, updated=None, deleted=None, active=None, shardId=None, attributes=None, accounting=None, premiumInfo=None, businessUserInfo=None,):\n    self.id = id\n    self.username = username\n    self.email = email\n    self.name = name\n    self.timezone = timezone\n    self.privilege = privilege\n    self.created = created\n    self.updated = updated\n    self.deleted = deleted\n    self.active = active\n    self.shardId = shardId\n    self.attributes = attributes\n    self.accounting = accounting\n    self.premiumInfo = premiumInfo\n    self.businessUserInfo = businessUserInfo\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I32:\n          self.id = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.username = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.email = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.name = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.STRING:\n          self.timezone = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.I32:\n          self.privilege = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.I64:\n          self.created = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.I64:\n          self.updated = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.I64:\n          self.deleted = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 13:\n        if ftype == TType.BOOL:\n          self.active = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 14:\n        if ftype == TType.STRING:\n          self.shardId = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 15:\n        if ftype == TType.STRUCT:\n          self.attributes = UserAttributes()\n          self.attributes.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 16:\n        if ftype == TType.STRUCT:\n          self.accounting = Accounting()\n          self.accounting.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 17:\n        if ftype == TType.STRUCT:\n          self.premiumInfo = PremiumInfo()\n          self.premiumInfo.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 18:\n        if ftype == TType.STRUCT:\n          self.businessUserInfo = BusinessUserInfo()\n          self.businessUserInfo.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('User')\n    if self.id is not None:\n      oprot.writeFieldBegin('id', TType.I32, 1)\n      oprot.writeI32(self.id)\n      oprot.writeFieldEnd()\n    if self.username is not None:\n      oprot.writeFieldBegin('username', TType.STRING, 2)\n      oprot.writeString(self.username)\n      oprot.writeFieldEnd()\n    if self.email is not None:\n      oprot.writeFieldBegin('email', TType.STRING, 3)\n      oprot.writeString(self.email)\n      oprot.writeFieldEnd()\n    if self.name is not None:\n      oprot.writeFieldBegin('name', TType.STRING, 4)\n      oprot.writeString(self.name)\n      oprot.writeFieldEnd()\n    if self.timezone is not None:\n      oprot.writeFieldBegin('timezone', TType.STRING, 6)\n      oprot.writeString(self.timezone)\n      oprot.writeFieldEnd()\n    if self.privilege is not None:\n      oprot.writeFieldBegin('privilege', TType.I32, 7)\n      oprot.writeI32(self.privilege)\n      oprot.writeFieldEnd()\n    if self.created is not None:\n      oprot.writeFieldBegin('created', TType.I64, 9)\n      oprot.writeI64(self.created)\n      oprot.writeFieldEnd()\n    if self.updated is not None:\n      oprot.writeFieldBegin('updated', TType.I64, 10)\n      oprot.writeI64(self.updated)\n      oprot.writeFieldEnd()\n    if self.deleted is not None:\n      oprot.writeFieldBegin('deleted', TType.I64, 11)\n      oprot.writeI64(self.deleted)\n      oprot.writeFieldEnd()\n    if self.active is not None:\n      oprot.writeFieldBegin('active', TType.BOOL, 13)\n      oprot.writeBool(self.active)\n      oprot.writeFieldEnd()\n    if self.shardId is not None:\n      oprot.writeFieldBegin('shardId', TType.STRING, 14)\n      oprot.writeString(self.shardId)\n      oprot.writeFieldEnd()\n    if self.attributes is not None:\n      oprot.writeFieldBegin('attributes', TType.STRUCT, 15)\n      self.attributes.write(oprot)\n      oprot.writeFieldEnd()\n    if self.accounting is not None:\n      oprot.writeFieldBegin('accounting', TType.STRUCT, 16)\n      self.accounting.write(oprot)\n      oprot.writeFieldEnd()\n    if self.premiumInfo is not None:\n      oprot.writeFieldBegin('premiumInfo', TType.STRUCT, 17)\n      self.premiumInfo.write(oprot)\n      oprot.writeFieldEnd()\n    if self.businessUserInfo is not None:\n      oprot.writeFieldBegin('businessUserInfo', TType.STRUCT, 18)\n      self.businessUserInfo.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass Tag(object):\n  \"\"\"\n   A tag within a user's account is a unique name which may be organized\n   a simple hierarchy.\n  <dl>\n   <dt>guid</dt>\n     <dd>The unique identifier of this tag. Will be set by the service,\n     so may be omitted by the client when creating the Tag.\n     <br/>\n     Length:  EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX\n     <br/>\n     Regex:  EDAM_GUID_REGEX\n     </dd>\n  \n   <dt>name</dt>\n     <dd>A sequence of characters representing the tag's identifier.\n     Case is preserved, but is ignored for comparisons.\n     This means that an account may only have one tag with a given name, via\n     case-insensitive comparison, so an account may not have both \"food\" and\n     \"Food\" tags.\n     May not contain a comma (','), and may not begin or end with a space.\n     <br/>\n     Length:  EDAM_TAG_NAME_LEN_MIN - EDAM_TAG_NAME_LEN_MAX\n     <br/>\n     Regex:  EDAM_TAG_NAME_REGEX\n     </dd>\n  \n   <dt>parentGuid</dt>\n     <dd>If this is set, then this is the GUID of the tag that\n     holds this tag within the tag organizational hierarchy.  If this is\n     not set, then the tag has no parent and it is a \"top level\" tag.\n     Cycles are not allowed (e.g. a->parent->parent == a) and will be\n     rejected by the service.\n     <br/>\n     Length:  EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX\n     <br/>\n     Regex:  EDAM_GUID_REGEX\n     </dd>\n  \n   <dt>updateSequenceNum</dt>\n     <dd>A number identifying the last transaction to\n     modify the state of this object.  The USN values are sequential within an\n     account, and can be used to compare the order of modifications within the\n     service.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - guid\n   - name\n   - parentGuid\n   - updateSequenceNum\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'guid', None, None, ), # 1\n    (2, TType.STRING, 'name', None, None, ), # 2\n    (3, TType.STRING, 'parentGuid', None, None, ), # 3\n    (4, TType.I32, 'updateSequenceNum', None, None, ), # 4\n  )\n\n  def __init__(self, guid=None, name=None, parentGuid=None, updateSequenceNum=None,):\n    self.guid = guid\n    self.name = name\n    self.parentGuid = parentGuid\n    self.updateSequenceNum = updateSequenceNum\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.name = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.parentGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.I32:\n          self.updateSequenceNum = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('Tag')\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 1)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.name is not None:\n      oprot.writeFieldBegin('name', TType.STRING, 2)\n      oprot.writeString(self.name)\n      oprot.writeFieldEnd()\n    if self.parentGuid is not None:\n      oprot.writeFieldBegin('parentGuid', TType.STRING, 3)\n      oprot.writeString(self.parentGuid)\n      oprot.writeFieldEnd()\n    if self.updateSequenceNum is not None:\n      oprot.writeFieldBegin('updateSequenceNum', TType.I32, 4)\n      oprot.writeI32(self.updateSequenceNum)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass LazyMap(object):\n  \"\"\"\n  A structure that wraps a map of name/value pairs whose values are not\n  always present in the structure in order to reduce space when obtaining\n  batches of entities that contain the map.\n  \n  When the server provides the client with a LazyMap, it will fill in either\n  the keysOnly field or the fullMap field, but never both, based on the API\n  and parameters.\n  \n  When a client provides a LazyMap to the server as part of an update to\n  an object, the server will only update the LazyMap if the fullMap field is\n  set. If the fullMap field is not set, the server will not make any changes\n  to the map.\n  \n  Check the API documentation of the individual calls involving the LazyMap\n  for full details including the constraints of the names and values of the\n  map.\n  \n  <dl>\n  <dt>keysOnly</dt>\n    <dd>The set of keys for the map.  This field is ignored by the\n        server when set.\n    </dd>\n  \n  <dt>fullMap</dt>\n    <dd>The complete map, including all keys and values.\n    </dd>\n  </dl>\n  \n  Attributes:\n   - keysOnly\n   - fullMap\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.SET, 'keysOnly', (TType.STRING,None), None, ), # 1\n    (2, TType.MAP, 'fullMap', (TType.STRING,None,TType.STRING,None), None, ), # 2\n  )\n\n  def __init__(self, keysOnly=None, fullMap=None,):\n    self.keysOnly = keysOnly\n    self.fullMap = fullMap\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.SET:\n          self.keysOnly = set()\n          (_etype17, _size14) = iprot.readSetBegin()\n          for _i18 in xrange(_size14):\n            _elem19 = iprot.readString();\n            self.keysOnly.add(_elem19)\n          iprot.readSetEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.MAP:\n          self.fullMap = {}\n          (_ktype21, _vtype22, _size20 ) = iprot.readMapBegin() \n          for _i24 in xrange(_size20):\n            _key25 = iprot.readString();\n            _val26 = iprot.readString();\n            self.fullMap[_key25] = _val26\n          iprot.readMapEnd()\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('LazyMap')\n    if self.keysOnly is not None:\n      oprot.writeFieldBegin('keysOnly', TType.SET, 1)\n      oprot.writeSetBegin(TType.STRING, len(self.keysOnly))\n      for iter27 in self.keysOnly:\n        oprot.writeString(iter27)\n      oprot.writeSetEnd()\n      oprot.writeFieldEnd()\n    if self.fullMap is not None:\n      oprot.writeFieldBegin('fullMap', TType.MAP, 2)\n      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.fullMap))\n      for kiter28,viter29 in self.fullMap.items():\n        oprot.writeString(kiter28)\n        oprot.writeString(viter29)\n      oprot.writeMapEnd()\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass ResourceAttributes(object):\n  \"\"\"\n  Structure holding the optional attributes of a Resource\n  <dl>\n  <dt>sourceURL</dt>\n    <dd>the original location where the resource was hosted\n    <br/>\n     Length:  EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX\n    </dd>\n  \n  <dt>timestamp</dt>\n    <dd>the date and time that is associated with this resource\n    (e.g. the time embedded in an image from a digital camera with a clock)\n    </dd>\n  \n  <dt>latitude</dt>\n    <dd>the latitude where the resource was captured\n    </dd>\n  \n  <dt>longitude</dt>\n    <dd>the longitude where the resource was captured\n    </dd>\n  \n  <dt>altitude</dt>\n    <dd>the altitude where the resource was captured\n    </dd>\n  \n  <dt>cameraMake</dt>\n    <dd>information about an image's camera, e.g. as embedded in\n    the image's EXIF data\n    <br/>\n    Length:  EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX\n    </dd>\n  \n  <dt>cameraModel</dt>\n    <dd>information about an image's camera, e.g. as embedded\n    in the image's EXIF data\n    <br/>\n    Length:  EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX\n    </dd>\n  \n  <dt>clientWillIndex</dt>\n    <dd>if true, then the original client that submitted\n    the resource plans to submit the recognition index for this resource at a\n    later time.\n    </dd>\n  \n  <dt>recoType</dt>\n    <dd>DEPRECATED - this field is no longer set by the service, so should\n      be ignored.\n    </dd>\n  \n  <dt>fileName</dt>\n    <dd>if the resource came from a source that provided an\n    explicit file name, the original name will be stored here.  Many resources\n    come from unnamed sources, so this will not always be set.\n    </dd>\n  \n  <dt>attachment</dt>\n    <dd>this will be true if the resource should be displayed as an attachment,\n    or false if the resource should be displayed inline (if possible).\n    </dd>\n  \n  <dt>applicationData</dt>\n  <dd>Provides a location for applications to store a relatively small\n  (4kb) blob of data associated with a Resource that is not visible to the user\n  and that is opaque to the Evernote service. A single application may use at most\n  one entry in this map, using its API consumer key as the map key. See the\n  documentation for LazyMap for a description of when the actual map values\n  are returned by the service.\n  <p>To safely add or modify your application's entry in the map, use\n  NoteStore.setResourceApplicationDataEntry. To safely remove your application's\n  entry from the map, use NoteStore.unsetResourceApplicationDataEntry.</p>\n  Minimum length of a name (key): EDAM_APPLICATIONDATA_NAME_LEN_MIN\n  <br/>\n  Sum max size of key and value: EDAM_APPLICATIONDATA_ENTRY_LEN_MAX\n  <br/>\n  Syntax regex for name (key): EDAM_APPLICATIONDATA_NAME_REGEX\n  </dd>\n  \n  </dl>\n  \n  Attributes:\n   - sourceURL\n   - timestamp\n   - latitude\n   - longitude\n   - altitude\n   - cameraMake\n   - cameraModel\n   - clientWillIndex\n   - recoType\n   - fileName\n   - attachment\n   - applicationData\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'sourceURL', None, None, ), # 1\n    (2, TType.I64, 'timestamp', None, None, ), # 2\n    (3, TType.DOUBLE, 'latitude', None, None, ), # 3\n    (4, TType.DOUBLE, 'longitude', None, None, ), # 4\n    (5, TType.DOUBLE, 'altitude', None, None, ), # 5\n    (6, TType.STRING, 'cameraMake', None, None, ), # 6\n    (7, TType.STRING, 'cameraModel', None, None, ), # 7\n    (8, TType.BOOL, 'clientWillIndex', None, None, ), # 8\n    (9, TType.STRING, 'recoType', None, None, ), # 9\n    (10, TType.STRING, 'fileName', None, None, ), # 10\n    (11, TType.BOOL, 'attachment', None, None, ), # 11\n    (12, TType.STRUCT, 'applicationData', (LazyMap, LazyMap.thrift_spec), None, ), # 12\n  )\n\n  def __init__(self, sourceURL=None, timestamp=None, latitude=None, longitude=None, altitude=None, cameraMake=None, cameraModel=None, clientWillIndex=None, recoType=None, fileName=None, attachment=None, applicationData=None,):\n    self.sourceURL = sourceURL\n    self.timestamp = timestamp\n    self.latitude = latitude\n    self.longitude = longitude\n    self.altitude = altitude\n    self.cameraMake = cameraMake\n    self.cameraModel = cameraModel\n    self.clientWillIndex = clientWillIndex\n    self.recoType = recoType\n    self.fileName = fileName\n    self.attachment = attachment\n    self.applicationData = applicationData\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.sourceURL = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I64:\n          self.timestamp = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.DOUBLE:\n          self.latitude = iprot.readDouble();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.DOUBLE:\n          self.longitude = iprot.readDouble();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.DOUBLE:\n          self.altitude = iprot.readDouble();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.STRING:\n          self.cameraMake = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.STRING:\n          self.cameraModel = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.BOOL:\n          self.clientWillIndex = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.STRING:\n          self.recoType = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.STRING:\n          self.fileName = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.BOOL:\n          self.attachment = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.STRUCT:\n          self.applicationData = LazyMap()\n          self.applicationData.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('ResourceAttributes')\n    if self.sourceURL is not None:\n      oprot.writeFieldBegin('sourceURL', TType.STRING, 1)\n      oprot.writeString(self.sourceURL)\n      oprot.writeFieldEnd()\n    if self.timestamp is not None:\n      oprot.writeFieldBegin('timestamp', TType.I64, 2)\n      oprot.writeI64(self.timestamp)\n      oprot.writeFieldEnd()\n    if self.latitude is not None:\n      oprot.writeFieldBegin('latitude', TType.DOUBLE, 3)\n      oprot.writeDouble(self.latitude)\n      oprot.writeFieldEnd()\n    if self.longitude is not None:\n      oprot.writeFieldBegin('longitude', TType.DOUBLE, 4)\n      oprot.writeDouble(self.longitude)\n      oprot.writeFieldEnd()\n    if self.altitude is not None:\n      oprot.writeFieldBegin('altitude', TType.DOUBLE, 5)\n      oprot.writeDouble(self.altitude)\n      oprot.writeFieldEnd()\n    if self.cameraMake is not None:\n      oprot.writeFieldBegin('cameraMake', TType.STRING, 6)\n      oprot.writeString(self.cameraMake)\n      oprot.writeFieldEnd()\n    if self.cameraModel is not None:\n      oprot.writeFieldBegin('cameraModel', TType.STRING, 7)\n      oprot.writeString(self.cameraModel)\n      oprot.writeFieldEnd()\n    if self.clientWillIndex is not None:\n      oprot.writeFieldBegin('clientWillIndex', TType.BOOL, 8)\n      oprot.writeBool(self.clientWillIndex)\n      oprot.writeFieldEnd()\n    if self.recoType is not None:\n      oprot.writeFieldBegin('recoType', TType.STRING, 9)\n      oprot.writeString(self.recoType)\n      oprot.writeFieldEnd()\n    if self.fileName is not None:\n      oprot.writeFieldBegin('fileName', TType.STRING, 10)\n      oprot.writeString(self.fileName)\n      oprot.writeFieldEnd()\n    if self.attachment is not None:\n      oprot.writeFieldBegin('attachment', TType.BOOL, 11)\n      oprot.writeBool(self.attachment)\n      oprot.writeFieldEnd()\n    if self.applicationData is not None:\n      oprot.writeFieldBegin('applicationData', TType.STRUCT, 12)\n      self.applicationData.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass Resource(object):\n  \"\"\"\n  Every media file that is embedded or attached to a note is represented\n  through a Resource entry.\n  <dl>\n  <dt>guid</dt>\n    <dd>The unique identifier of this resource.  Will be set whenever\n    a resource is retrieved from the service, but may be null when a client\n    is creating a resource.\n    <br/>\n    Length:  EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX\n    <br/>\n    Regex:  EDAM_GUID_REGEX\n    </dd>\n  \n  <dt>noteGuid</dt>\n    <dd>The unique identifier of the Note that holds this\n    Resource. Will be set whenever the resource is retrieved from the service,\n    but may be null when a client is creating a resource.\n    <br/>\n    Length:  EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX\n    <br/>\n    Regex:  EDAM_GUID_REGEX\n    </dd>\n  \n  <dt>data</dt>\n    <dd>The contents of the resource.\n    Maximum length:  The data.body is limited to EDAM_RESOURCE_SIZE_MAX_FREE\n    for free accounts and EDAM_RESOURCE_SIZE_MAX_PREMIUM for premium accounts.\n    </dd>\n  \n  <dt>mime</dt>\n    <dd>The MIME type for the embedded resource.  E.g. \"image/gif\"\n    <br/>\n    Length:  EDAM_MIME_LEN_MIN - EDAM_MIME_LEN_MAX\n    <br/>\n    Regex:  EDAM_MIME_REGEX\n    </dd>\n  \n  <dt>width</dt>\n    <dd>If set, this contains the display width of this resource, in\n    pixels.\n    </dd>\n  \n  <dt>height</dt>\n    <dd>If set, this contains the display height of this resource,\n    in pixels.\n    </dd>\n  \n  <dt>duration</dt>\n    <dd>DEPRECATED: ignored.\n    </dd>\n  \n  <dt>active</dt>\n    <dd>DEPRECATED: ignored.\n    </dd>\n  \n  <dt>recognition</dt>\n    <dd>If set, this will hold the encoded data that provides\n    information on search and recognition within this resource.\n    </dd>\n  \n  <dt>attributes</dt>\n    <dd>A list of the attributes for this resource.\n    </dd>\n  \n  <dt>updateSequenceNum</dt>\n    <dd>A number identifying the last transaction to\n    modify the state of this object. The USN values are sequential within an\n    account, and can be used to compare the order of modifications within the\n    service.\n    </dd>\n  \n  <dt>alternateData</dt>\n    <dd>Some Resources may be assigned an alternate data format by the service\n    which may be more appropriate for indexing or rendering than the original\n    data provided by the user.  In these cases, the alternate data form will\n    be available via this Data element.  If a Resource has no alternate form,\n    this field will be unset.</dd>\n  </dl>\n  \n  Attributes:\n   - guid\n   - noteGuid\n   - data\n   - mime\n   - width\n   - height\n   - duration\n   - active\n   - recognition\n   - attributes\n   - updateSequenceNum\n   - alternateData\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'guid', None, None, ), # 1\n    (2, TType.STRING, 'noteGuid', None, None, ), # 2\n    (3, TType.STRUCT, 'data', (Data, Data.thrift_spec), None, ), # 3\n    (4, TType.STRING, 'mime', None, None, ), # 4\n    (5, TType.I16, 'width', None, None, ), # 5\n    (6, TType.I16, 'height', None, None, ), # 6\n    (7, TType.I16, 'duration', None, None, ), # 7\n    (8, TType.BOOL, 'active', None, None, ), # 8\n    (9, TType.STRUCT, 'recognition', (Data, Data.thrift_spec), None, ), # 9\n    None, # 10\n    (11, TType.STRUCT, 'attributes', (ResourceAttributes, ResourceAttributes.thrift_spec), None, ), # 11\n    (12, TType.I32, 'updateSequenceNum', None, None, ), # 12\n    (13, TType.STRUCT, 'alternateData', (Data, Data.thrift_spec), None, ), # 13\n  )\n\n  def __init__(self, guid=None, noteGuid=None, data=None, mime=None, width=None, height=None, duration=None, active=None, recognition=None, attributes=None, updateSequenceNum=None, alternateData=None,):\n    self.guid = guid\n    self.noteGuid = noteGuid\n    self.data = data\n    self.mime = mime\n    self.width = width\n    self.height = height\n    self.duration = duration\n    self.active = active\n    self.recognition = recognition\n    self.attributes = attributes\n    self.updateSequenceNum = updateSequenceNum\n    self.alternateData = alternateData\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.noteGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.data = Data()\n          self.data.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.mime = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.I16:\n          self.width = iprot.readI16();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.I16:\n          self.height = iprot.readI16();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.I16:\n          self.duration = iprot.readI16();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.BOOL:\n          self.active = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.STRUCT:\n          self.recognition = Data()\n          self.recognition.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.STRUCT:\n          self.attributes = ResourceAttributes()\n          self.attributes.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.I32:\n          self.updateSequenceNum = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 13:\n        if ftype == TType.STRUCT:\n          self.alternateData = Data()\n          self.alternateData.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('Resource')\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 1)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.noteGuid is not None:\n      oprot.writeFieldBegin('noteGuid', TType.STRING, 2)\n      oprot.writeString(self.noteGuid)\n      oprot.writeFieldEnd()\n    if self.data is not None:\n      oprot.writeFieldBegin('data', TType.STRUCT, 3)\n      self.data.write(oprot)\n      oprot.writeFieldEnd()\n    if self.mime is not None:\n      oprot.writeFieldBegin('mime', TType.STRING, 4)\n      oprot.writeString(self.mime)\n      oprot.writeFieldEnd()\n    if self.width is not None:\n      oprot.writeFieldBegin('width', TType.I16, 5)\n      oprot.writeI16(self.width)\n      oprot.writeFieldEnd()\n    if self.height is not None:\n      oprot.writeFieldBegin('height', TType.I16, 6)\n      oprot.writeI16(self.height)\n      oprot.writeFieldEnd()\n    if self.duration is not None:\n      oprot.writeFieldBegin('duration', TType.I16, 7)\n      oprot.writeI16(self.duration)\n      oprot.writeFieldEnd()\n    if self.active is not None:\n      oprot.writeFieldBegin('active', TType.BOOL, 8)\n      oprot.writeBool(self.active)\n      oprot.writeFieldEnd()\n    if self.recognition is not None:\n      oprot.writeFieldBegin('recognition', TType.STRUCT, 9)\n      self.recognition.write(oprot)\n      oprot.writeFieldEnd()\n    if self.attributes is not None:\n      oprot.writeFieldBegin('attributes', TType.STRUCT, 11)\n      self.attributes.write(oprot)\n      oprot.writeFieldEnd()\n    if self.updateSequenceNum is not None:\n      oprot.writeFieldBegin('updateSequenceNum', TType.I32, 12)\n      oprot.writeI32(self.updateSequenceNum)\n      oprot.writeFieldEnd()\n    if self.alternateData is not None:\n      oprot.writeFieldBegin('alternateData', TType.STRUCT, 13)\n      self.alternateData.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass NoteAttributes(object):\n  \"\"\"\n  The list of optional attributes that can be stored on a note.\n  <dl>\n  <dt>subjectDate</dt>\n    <dd>time that the note refers to\n    </dd>\n  \n  <dt>latitude</dt>\n    <dd>the latitude where the note was taken\n    </dd>\n  \n  <dt>longitude</dt>\n    <dd>the longitude where the note was taken\n    </dd>\n  \n  <dt>altitude</dt>\n    <dd>the altitude where the note was taken\n    </dd>\n  \n  <dt>author</dt>\n    <dd>the author of the content of the note\n    <br/>\n    Length:  EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX\n    </dd>\n  \n  <dt>source</dt>\n    <dd>the method that the note was added to the account, if the\n    note wasn't directly authored in an Evernote desktop client.\n    <br/>\n    Length:  EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX\n    </dd>\n  \n  <dt>sourceURL</dt>\n    <dd>the original location where the resource was hosted. For web clips,\n    this will be the URL of the page that was clipped.\n    <br/>\n    Length:  EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX\n    </dd>\n  \n  <dt>sourceApplication</dt>\n    <dd>an identifying string for the application that\n    created this note.  This string does not have a guaranteed syntax or\n    structure -- it is intended for human inspection and tracking.\n    <br/>\n    Length:  EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX\n    </dd>\n  \n  <dt>shareDate</dt>\n   <dd>The date and time when this note was directly shared via its own URL.\n   This is only set on notes that were individually shared - it is independent\n   of any notebook-level sharing of the containing notebook. This field\n   is treated as \"read-only\" for clients; the server will ignore changes\n   to this field from an external client.\n   </dd>\n  \n  <dt>reminderOrder</dt>\n  <dd>The set of notes with this parameter set are considered\n  \"reminders\" and are to be treated specially by clients to give them\n  higher UI prominence within a notebook.  The value is used to sort\n  the reminder notes within the notebook with higher values\n  representing greater prominence.  Outside of the context of a\n  notebook, the value of this parameter is undefined.  The value is\n  not intended to be compared to the values of reminder notes in\n  other notebooks.  In order to allow clients to place a note at a\n  higher precedence than other notes, you should never set a value\n  greater than the current time (as defined for a Timetstamp). To\n  place a note at higher precedence than existing notes, set the\n  value to the current time as defined for a timestamp (milliseconds\n  since the epoch).  Synchronizing clients must remember the time when\n  the update was performed, using the local clock on the client,\n  and use that value when they later upload the note to the service.\n  Clients must not set the reminderOrder to the reminderTime as the\n  reminderTime could be in the future.  Those two fields are never\n  intended to be related.  The correct value for reminderOrder field\n  for new notes is the \"current\" time when the user indicated that\n  the note is a reminder.  Clients may implement a separate\n  \"sort by date\" feature to show notes ordered by reminderTime.\n  Whenever a reminderDoneTime or reminderTime is set but a\n  reminderOrder is not set, the server will fill in the current\n  server time for the reminderOrder field.</dd>\n  \n  <dt>reminderDoneTime</dt>\n  <dd>The date and time when a user dismissed/\"marked done\" the reminder\n  on the note.  Users typically do not manually set this value directly\n  as it is set to the time when the user dismissed/\"marked done\" the\n  reminder.</dd>\n  \n  <dt>reminderTime</dt>\n  <dd>The date and time a user has selected to be reminded of the note.\n  A note with this value set is known as a \"reminder\" and the user can\n  be reminded, via e-mail or client-specific notifications, of the note\n  when the time is reached or about to be reached.  When a user sets\n  a reminder time on a note that has a reminder done time, and that\n  reminder time is in the future, then the reminder done time should be\n  cleared.  This should happen regardless of any existing reminder time\n  that may have previously existed on the note.</dd>\n  \n  <dt>placeName</dt>\n  <dd>Allows the user to assign a human-readable location name associated\n  with a note. Users may assign values like 'Home' and 'Work'. Place\n  names may also be populated with values from geonames database\n  (e.g., a restaurant name). Applications are encouraged to normalize values\n  so that grouping values by place name provides a useful result. Applications\n  MUST NOT automatically add place name values based on geolocation without\n  confirmation from the user; that is, the value in this field should be\n  more useful than a simple automated lookup based on the note's latitude\n  and longitude.</dd>\n  \n  <dt>contentClass</dt>\n  <dd>The class (or type) of note. This field is used to indicate to\n  clients that special structured information is represented within\n  the note such that special rules apply when making\n  modifications. If contentClass is set and the client\n  application does not specifically support the specified class,\n  the client MUST treat the note as read-only. In this case, the\n  client MAY modify the note's notebook and tags via the\n  Note.notebookGuid and Note.tagGuids fields.  The client MAY also\n  modify the reminderOrder field as well as the reminderTime and\n  reminderDoneTime fields.\n  <p>Applications should set contentClass only when they are creating notes\n  that contain structured information that needs to be maintained in order\n  for the user to be able to use the note within that application.\n  Setting contentClass makes a note read-only in other applications, so\n  there is a trade-off when an application chooses to use contentClass.\n  Applications that set contentClass when creating notes must use a contentClass\n  string of the form <i>CompanyName.ApplicationName</i> to ensure uniqueness.</p>\n  Length restrictions: EDAM_NOTE_CONTENT_CLASS_LEN_MIN, EDAM_NOTE_CONTENT_CLASS_LEN_MAX\n  <br/>\n  Regex: EDAM_NOTE_CONTENT_CLASS_REGEX\n  </dd>\n  \n  <dt>applicationData</dt>\n  <dd>Provides a location for applications to store a relatively small\n  (4kb) blob of data that is not meant to be visible to the user and\n  that is opaque to the Evernote service. A single application may use at most\n  one entry in this map, using its API consumer key as the map key. See the\n  documentation for LazyMap for a description of when the actual map values\n  are returned by the service.\n  <p>To safely add or modify your application's entry in the map, use\n  NoteStore.setNoteApplicationDataEntry. To safely remove your application's\n  entry from the map, use NoteStore.unsetNoteApplicationDataEntry.</p>\n  Minimum length of a name (key): EDAM_APPLICATIONDATA_NAME_LEN_MIN\n  <br/>\n  Sum max size of key and value: EDAM_APPLICATIONDATA_ENTRY_LEN_MAX\n  <br/>\n  Syntax regex for name (key): EDAM_APPLICATIONDATA_NAME_REGEX\n  </dd>\n  \n  <dt>creatorId</dt>\n  <dd>The numeric user ID of the user who originally created the note.</dd>\n  \n  <dt>lastEditedBy</dt>\n  <dd>An indication of who made the last change to the note.  If you are\n  accessing the note via a shared notebook to which you have modification\n  rights, or if you are the owner of the notebook to which the note belongs,\n  then you have access to the value.  In this case, the value will be\n  unset if the owner of the notebook containing the note was the last to\n  make the modification, else it will be a string describing the\n  guest who made the last edit.  If you do not have access to this value,\n  it will be left unset.  This field is read-only by clients.  The server\n  will ignore all values set by clients into this field.</dd>\n  \n  <dt>lastEditorId</dt>\n  <dd>The numeric user ID of the user described in lastEditedBy.</dd>\n  \n  <dt>classifications</dt>\n  <dd>A map of classifications applied to the note by clients or by the\n  Evernote service. The key is the string name of the classification type,\n  and the value is a constant that begins with CLASSIFICATION_.</dd>\n  \n  </dl>\n  \n  Attributes:\n   - subjectDate\n   - latitude\n   - longitude\n   - altitude\n   - author\n   - source\n   - sourceURL\n   - sourceApplication\n   - shareDate\n   - reminderOrder\n   - reminderDoneTime\n   - reminderTime\n   - placeName\n   - contentClass\n   - applicationData\n   - lastEditedBy\n   - classifications\n   - creatorId\n   - lastEditorId\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I64, 'subjectDate', None, None, ), # 1\n    None, # 2\n    None, # 3\n    None, # 4\n    None, # 5\n    None, # 6\n    None, # 7\n    None, # 8\n    None, # 9\n    (10, TType.DOUBLE, 'latitude', None, None, ), # 10\n    (11, TType.DOUBLE, 'longitude', None, None, ), # 11\n    (12, TType.DOUBLE, 'altitude', None, None, ), # 12\n    (13, TType.STRING, 'author', None, None, ), # 13\n    (14, TType.STRING, 'source', None, None, ), # 14\n    (15, TType.STRING, 'sourceURL', None, None, ), # 15\n    (16, TType.STRING, 'sourceApplication', None, None, ), # 16\n    (17, TType.I64, 'shareDate', None, None, ), # 17\n    (18, TType.I64, 'reminderOrder', None, None, ), # 18\n    (19, TType.I64, 'reminderDoneTime', None, None, ), # 19\n    (20, TType.I64, 'reminderTime', None, None, ), # 20\n    (21, TType.STRING, 'placeName', None, None, ), # 21\n    (22, TType.STRING, 'contentClass', None, None, ), # 22\n    (23, TType.STRUCT, 'applicationData', (LazyMap, LazyMap.thrift_spec), None, ), # 23\n    (24, TType.STRING, 'lastEditedBy', None, None, ), # 24\n    None, # 25\n    (26, TType.MAP, 'classifications', (TType.STRING,None,TType.STRING,None), None, ), # 26\n    (27, TType.I32, 'creatorId', None, None, ), # 27\n    (28, TType.I32, 'lastEditorId', None, None, ), # 28\n  )\n\n  def __init__(self, subjectDate=None, latitude=None, longitude=None, altitude=None, author=None, source=None, sourceURL=None, sourceApplication=None, shareDate=None, reminderOrder=None, reminderDoneTime=None, reminderTime=None, placeName=None, contentClass=None, applicationData=None, lastEditedBy=None, classifications=None, creatorId=None, lastEditorId=None,):\n    self.subjectDate = subjectDate\n    self.latitude = latitude\n    self.longitude = longitude\n    self.altitude = altitude\n    self.author = author\n    self.source = source\n    self.sourceURL = sourceURL\n    self.sourceApplication = sourceApplication\n    self.shareDate = shareDate\n    self.reminderOrder = reminderOrder\n    self.reminderDoneTime = reminderDoneTime\n    self.reminderTime = reminderTime\n    self.placeName = placeName\n    self.contentClass = contentClass\n    self.applicationData = applicationData\n    self.lastEditedBy = lastEditedBy\n    self.classifications = classifications\n    self.creatorId = creatorId\n    self.lastEditorId = lastEditorId\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I64:\n          self.subjectDate = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.DOUBLE:\n          self.latitude = iprot.readDouble();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.DOUBLE:\n          self.longitude = iprot.readDouble();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.DOUBLE:\n          self.altitude = iprot.readDouble();\n        else:\n          iprot.skip(ftype)\n      elif fid == 13:\n        if ftype == TType.STRING:\n          self.author = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 14:\n        if ftype == TType.STRING:\n          self.source = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 15:\n        if ftype == TType.STRING:\n          self.sourceURL = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 16:\n        if ftype == TType.STRING:\n          self.sourceApplication = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 17:\n        if ftype == TType.I64:\n          self.shareDate = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 18:\n        if ftype == TType.I64:\n          self.reminderOrder = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 19:\n        if ftype == TType.I64:\n          self.reminderDoneTime = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 20:\n        if ftype == TType.I64:\n          self.reminderTime = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 21:\n        if ftype == TType.STRING:\n          self.placeName = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 22:\n        if ftype == TType.STRING:\n          self.contentClass = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 23:\n        if ftype == TType.STRUCT:\n          self.applicationData = LazyMap()\n          self.applicationData.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 24:\n        if ftype == TType.STRING:\n          self.lastEditedBy = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 26:\n        if ftype == TType.MAP:\n          self.classifications = {}\n          (_ktype31, _vtype32, _size30 ) = iprot.readMapBegin() \n          for _i34 in xrange(_size30):\n            _key35 = iprot.readString();\n            _val36 = iprot.readString();\n            self.classifications[_key35] = _val36\n          iprot.readMapEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 27:\n        if ftype == TType.I32:\n          self.creatorId = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 28:\n        if ftype == TType.I32:\n          self.lastEditorId = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('NoteAttributes')\n    if self.subjectDate is not None:\n      oprot.writeFieldBegin('subjectDate', TType.I64, 1)\n      oprot.writeI64(self.subjectDate)\n      oprot.writeFieldEnd()\n    if self.latitude is not None:\n      oprot.writeFieldBegin('latitude', TType.DOUBLE, 10)\n      oprot.writeDouble(self.latitude)\n      oprot.writeFieldEnd()\n    if self.longitude is not None:\n      oprot.writeFieldBegin('longitude', TType.DOUBLE, 11)\n      oprot.writeDouble(self.longitude)\n      oprot.writeFieldEnd()\n    if self.altitude is not None:\n      oprot.writeFieldBegin('altitude', TType.DOUBLE, 12)\n      oprot.writeDouble(self.altitude)\n      oprot.writeFieldEnd()\n    if self.author is not None:\n      oprot.writeFieldBegin('author', TType.STRING, 13)\n      oprot.writeString(self.author)\n      oprot.writeFieldEnd()\n    if self.source is not None:\n      oprot.writeFieldBegin('source', TType.STRING, 14)\n      oprot.writeString(self.source)\n      oprot.writeFieldEnd()\n    if self.sourceURL is not None:\n      oprot.writeFieldBegin('sourceURL', TType.STRING, 15)\n      oprot.writeString(self.sourceURL)\n      oprot.writeFieldEnd()\n    if self.sourceApplication is not None:\n      oprot.writeFieldBegin('sourceApplication', TType.STRING, 16)\n      oprot.writeString(self.sourceApplication)\n      oprot.writeFieldEnd()\n    if self.shareDate is not None:\n      oprot.writeFieldBegin('shareDate', TType.I64, 17)\n      oprot.writeI64(self.shareDate)\n      oprot.writeFieldEnd()\n    if self.reminderOrder is not None:\n      oprot.writeFieldBegin('reminderOrder', TType.I64, 18)\n      oprot.writeI64(self.reminderOrder)\n      oprot.writeFieldEnd()\n    if self.reminderDoneTime is not None:\n      oprot.writeFieldBegin('reminderDoneTime', TType.I64, 19)\n      oprot.writeI64(self.reminderDoneTime)\n      oprot.writeFieldEnd()\n    if self.reminderTime is not None:\n      oprot.writeFieldBegin('reminderTime', TType.I64, 20)\n      oprot.writeI64(self.reminderTime)\n      oprot.writeFieldEnd()\n    if self.placeName is not None:\n      oprot.writeFieldBegin('placeName', TType.STRING, 21)\n      oprot.writeString(self.placeName)\n      oprot.writeFieldEnd()\n    if self.contentClass is not None:\n      oprot.writeFieldBegin('contentClass', TType.STRING, 22)\n      oprot.writeString(self.contentClass)\n      oprot.writeFieldEnd()\n    if self.applicationData is not None:\n      oprot.writeFieldBegin('applicationData', TType.STRUCT, 23)\n      self.applicationData.write(oprot)\n      oprot.writeFieldEnd()\n    if self.lastEditedBy is not None:\n      oprot.writeFieldBegin('lastEditedBy', TType.STRING, 24)\n      oprot.writeString(self.lastEditedBy)\n      oprot.writeFieldEnd()\n    if self.classifications is not None:\n      oprot.writeFieldBegin('classifications', TType.MAP, 26)\n      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.classifications))\n      for kiter37,viter38 in self.classifications.items():\n        oprot.writeString(kiter37)\n        oprot.writeString(viter38)\n      oprot.writeMapEnd()\n      oprot.writeFieldEnd()\n    if self.creatorId is not None:\n      oprot.writeFieldBegin('creatorId', TType.I32, 27)\n      oprot.writeI32(self.creatorId)\n      oprot.writeFieldEnd()\n    if self.lastEditorId is not None:\n      oprot.writeFieldBegin('lastEditorId', TType.I32, 28)\n      oprot.writeI32(self.lastEditorId)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass Note(object):\n  \"\"\"\n  Represents a single note in the user's account.\n  \n  <dl>\n  <dt>guid</dt>\n    <dd>The unique identifier of this note.  Will be set by the\n    server, but will be omitted by clients calling NoteStore.createNote()\n    <br/>\n    Length:  EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX\n    <br/>\n    Regex:  EDAM_GUID_REGEX\n    </dd>\n  \n  <dt>title</dt>\n    <dd>The subject of the note.  Can't begin or end with a space.\n    <br/>\n    Length:  EDAM_NOTE_TITLE_LEN_MIN - EDAM_NOTE_TITLE_LEN_MAX\n    <br/>\n    Regex:  EDAM_NOTE_TITLE_REGEX\n    </dd>\n  \n  <dt>content</dt>\n    <dd>The XHTML block that makes up the note.  This is\n    the canonical form of the note's contents, so will include abstract\n    Evernote tags for internal resource references.  A client may create\n    a separate transformed version of this content for internal presentation,\n    but the same canonical bytes should be used for transmission and\n    comparison unless the user chooses to modify their content.\n    <br/>\n    Length:  EDAM_NOTE_CONTENT_LEN_MIN - EDAM_NOTE_CONTENT_LEN_MAX\n    </dd>\n  \n  <dt>contentHash</dt>\n    <dd>The binary MD5 checksum of the UTF-8 encoded content\n    body. This will always be set by the server, but clients may choose to omit\n    this when they submit a note with content.\n    <br/>\n    Length:  EDAM_HASH_LEN (exactly)\n    </dd>\n  \n  <dt>contentLength</dt>\n    <dd>The number of Unicode characters in the content of\n    the note.  This will always be set by the service, but clients may choose\n    to omit this value when they submit a Note.\n    </dd>\n  \n  <dt>created</dt>\n    <dd>The date and time when the note was created in one of the\n    clients.  In most cases, this will match the user's sense of when\n    the note was created, and ordering between notes will be based on\n    ordering of this field.  However, this is not a \"reliable\" timestamp\n    if a client has an incorrect clock, so it cannot provide a true absolute\n    ordering between notes.  Notes created directly through the service\n    (e.g. via the web GUI) will have an absolutely ordered \"created\" value.\n    </dd>\n  \n  <dt>updated</dt>\n    <dd>The date and time when the note was last modified in one of\n    the clients.  In most cases, this will match the user's sense of when\n    the note was modified, but this field may not be absolutely reliable\n    due to the possibility of client clock errors.\n    </dd>\n  \n  <dt>deleted</dt>\n    <dd>If present, the note is considered \"deleted\", and this\n    stores the date and time when the note was deleted by one of the clients.\n    In most cases, this will match the user's sense of when the note was\n    deleted, but this field may be unreliable due to the possibility of\n    client clock errors.\n    </dd>\n  \n  <dt>active</dt>\n    <dd>If the note is available for normal actions and viewing,\n    this flag will be set to true.\n    </dd>\n  \n  <dt>updateSequenceNum</dt>\n    <dd>A number identifying the last transaction to\n    modify the state of this note (including changes to the note's attributes\n    or resources).  The USN values are sequential within an account,\n    and can be used to compare the order of modifications within the service.\n    </dd>\n  \n  <dt>notebookGuid</dt>\n    <dd>The unique identifier of the notebook that contains\n    this note.  If no notebookGuid is provided on a call to createNote(), the\n    default notebook will be used instead.\n    <br/>\n    Length:  EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX\n    <br/>\n    Regex:  EDAM_GUID_REGEX\n    </dd>\n  \n  <dt>tagGuids</dt>\n    <dd>A list of the GUID identifiers for tags that are applied to this note.\n    This may be provided in a call to createNote() to unambiguously declare\n    the tags that should be assigned to the new note.  Alternately, clients\n    may pass the names of desired tags via the 'tagNames' field during\n    note creation.\n    If the list of tags are omitted on a call to createNote(), then\n    the server will assume that no changes have been made to the resources.\n    Maximum:  EDAM_NOTE_TAGS_MAX tags per note\n    </dd>\n  \n  <dt>resources</dt>\n    <dd>The list of resources that are embedded within this note.\n    If the list of resources are omitted on a call to updateNote(), then\n    the server will assume that no changes have been made to the resources.\n    The binary contents of the resources must be provided when the resource\n    is first sent to the service, but it will be omitted by the service when\n    the Note is returned in the future.\n    Maximum:  EDAM_NOTE_RESOURCES_MAX resources per note\n    </dd>\n  \n  <dt>attributes</dt>\n    <dd>A list of the attributes for this note.\n    If the list of attributes are omitted on a call to updateNote(), then\n    the server will assume that no changes have been made to the resources.\n    </dd>\n  \n  <dt>tagNames</dt>\n    <dd>May be provided by clients during calls to createNote() as an\n    alternative to providing the tagGuids of existing tags.  If any tagNames\n    are provided during createNote(), these will be found, or created if they\n    don't already exist.  Created tags will have no parent (they will be at\n    the top level of the tag panel).\n    </dd>\n  </dl>\n  \n  Attributes:\n   - guid\n   - title\n   - content\n   - contentHash\n   - contentLength\n   - created\n   - updated\n   - deleted\n   - active\n   - updateSequenceNum\n   - notebookGuid\n   - tagGuids\n   - resources\n   - attributes\n   - tagNames\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'guid', None, None, ), # 1\n    (2, TType.STRING, 'title', None, None, ), # 2\n    (3, TType.STRING, 'content', None, None, ), # 3\n    (4, TType.STRING, 'contentHash', None, None, ), # 4\n    (5, TType.I32, 'contentLength', None, None, ), # 5\n    (6, TType.I64, 'created', None, None, ), # 6\n    (7, TType.I64, 'updated', None, None, ), # 7\n    (8, TType.I64, 'deleted', None, None, ), # 8\n    (9, TType.BOOL, 'active', None, None, ), # 9\n    (10, TType.I32, 'updateSequenceNum', None, None, ), # 10\n    (11, TType.STRING, 'notebookGuid', None, None, ), # 11\n    (12, TType.LIST, 'tagGuids', (TType.STRING,None), None, ), # 12\n    (13, TType.LIST, 'resources', (TType.STRUCT,(Resource, Resource.thrift_spec)), None, ), # 13\n    (14, TType.STRUCT, 'attributes', (NoteAttributes, NoteAttributes.thrift_spec), None, ), # 14\n    (15, TType.LIST, 'tagNames', (TType.STRING,None), None, ), # 15\n  )\n\n  def __init__(self, guid=None, title=None, content=None, contentHash=None, contentLength=None, created=None, updated=None, deleted=None, active=None, updateSequenceNum=None, notebookGuid=None, tagGuids=None, resources=None, attributes=None, tagNames=None,):\n    self.guid = guid\n    self.title = title\n    self.content = content\n    self.contentHash = contentHash\n    self.contentLength = contentLength\n    self.created = created\n    self.updated = updated\n    self.deleted = deleted\n    self.active = active\n    self.updateSequenceNum = updateSequenceNum\n    self.notebookGuid = notebookGuid\n    self.tagGuids = tagGuids\n    self.resources = resources\n    self.attributes = attributes\n    self.tagNames = tagNames\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.title = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.content = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.contentHash = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.I32:\n          self.contentLength = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.I64:\n          self.created = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.I64:\n          self.updated = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.I64:\n          self.deleted = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.BOOL:\n          self.active = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.I32:\n          self.updateSequenceNum = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.STRING:\n          self.notebookGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.LIST:\n          self.tagGuids = []\n          (_etype42, _size39) = iprot.readListBegin()\n          for _i43 in xrange(_size39):\n            _elem44 = iprot.readString();\n            self.tagGuids.append(_elem44)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 13:\n        if ftype == TType.LIST:\n          self.resources = []\n          (_etype48, _size45) = iprot.readListBegin()\n          for _i49 in xrange(_size45):\n            _elem50 = Resource()\n            _elem50.read(iprot)\n            self.resources.append(_elem50)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 14:\n        if ftype == TType.STRUCT:\n          self.attributes = NoteAttributes()\n          self.attributes.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 15:\n        if ftype == TType.LIST:\n          self.tagNames = []\n          (_etype54, _size51) = iprot.readListBegin()\n          for _i55 in xrange(_size51):\n            _elem56 = iprot.readString();\n            self.tagNames.append(_elem56)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('Note')\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 1)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.title is not None:\n      oprot.writeFieldBegin('title', TType.STRING, 2)\n      oprot.writeString(self.title)\n      oprot.writeFieldEnd()\n    if self.content is not None:\n      oprot.writeFieldBegin('content', TType.STRING, 3)\n      oprot.writeString(self.content)\n      oprot.writeFieldEnd()\n    if self.contentHash is not None:\n      oprot.writeFieldBegin('contentHash', TType.STRING, 4)\n      oprot.writeString(self.contentHash)\n      oprot.writeFieldEnd()\n    if self.contentLength is not None:\n      oprot.writeFieldBegin('contentLength', TType.I32, 5)\n      oprot.writeI32(self.contentLength)\n      oprot.writeFieldEnd()\n    if self.created is not None:\n      oprot.writeFieldBegin('created', TType.I64, 6)\n      oprot.writeI64(self.created)\n      oprot.writeFieldEnd()\n    if self.updated is not None:\n      oprot.writeFieldBegin('updated', TType.I64, 7)\n      oprot.writeI64(self.updated)\n      oprot.writeFieldEnd()\n    if self.deleted is not None:\n      oprot.writeFieldBegin('deleted', TType.I64, 8)\n      oprot.writeI64(self.deleted)\n      oprot.writeFieldEnd()\n    if self.active is not None:\n      oprot.writeFieldBegin('active', TType.BOOL, 9)\n      oprot.writeBool(self.active)\n      oprot.writeFieldEnd()\n    if self.updateSequenceNum is not None:\n      oprot.writeFieldBegin('updateSequenceNum', TType.I32, 10)\n      oprot.writeI32(self.updateSequenceNum)\n      oprot.writeFieldEnd()\n    if self.notebookGuid is not None:\n      oprot.writeFieldBegin('notebookGuid', TType.STRING, 11)\n      oprot.writeString(self.notebookGuid)\n      oprot.writeFieldEnd()\n    if self.tagGuids is not None:\n      oprot.writeFieldBegin('tagGuids', TType.LIST, 12)\n      oprot.writeListBegin(TType.STRING, len(self.tagGuids))\n      for iter57 in self.tagGuids:\n        oprot.writeString(iter57)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.resources is not None:\n      oprot.writeFieldBegin('resources', TType.LIST, 13)\n      oprot.writeListBegin(TType.STRUCT, len(self.resources))\n      for iter58 in self.resources:\n        iter58.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.attributes is not None:\n      oprot.writeFieldBegin('attributes', TType.STRUCT, 14)\n      self.attributes.write(oprot)\n      oprot.writeFieldEnd()\n    if self.tagNames is not None:\n      oprot.writeFieldBegin('tagNames', TType.LIST, 15)\n      oprot.writeListBegin(TType.STRING, len(self.tagNames))\n      for iter59 in self.tagNames:\n        oprot.writeString(iter59)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass Publishing(object):\n  \"\"\"\n  If a Notebook has been opened to the public, the Notebook will have a\n  reference to one of these structures, which gives the location and optional\n  description of the externally-visible public Notebook.\n  <dl>\n  <dt>uri</dt>\n    <dd>If this field is present, then the notebook is published for\n    mass consumption on the Internet under the provided URI, which is\n    relative to a defined base publishing URI defined by the service.\n    This field can only be modified via the web service GUI ... publishing\n    cannot be modified via an offline client.\n    <br/>\n    Length:  EDAM_PUBLISHING_URI_LEN_MIN - EDAM_PUBLISHING_URI_LEN_MAX\n    <br/>\n    Regex:  EDAM_PUBLISHING_URI_REGEX\n    </dd>\n  \n  <dt>order</dt>\n    <dd>When the notes are publicly displayed, they will be sorted\n    based on the requested criteria.\n    </dd>\n  \n  <dt>ascending</dt>\n    <dd>If this is set to true, then the public notes will be\n    displayed in ascending order (e.g. from oldest to newest).  Otherwise,\n    the notes will be displayed in descending order (e.g. newest to oldest).\n    </dd>\n  \n  <dt>publicDescription</dt>\n    <dd>This field may be used to provide a short\n    description of the notebook, which may be displayed when (e.g.) the\n    notebook is shown in a public view.  Can't begin or end with a space.\n    <br/>\n    Length:  EDAM_PUBLISHING_DESCRIPTION_LEN_MIN -\n             EDAM_PUBLISHING_DESCRIPTION_LEN_MAX\n    <br/>\n    Regex:  EDAM_PUBLISHING_DESCRIPTION_REGEX\n    </dd>\n  \n  </dl>\n  \n  Attributes:\n   - uri\n   - order\n   - ascending\n   - publicDescription\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'uri', None, None, ), # 1\n    (2, TType.I32, 'order', None, None, ), # 2\n    (3, TType.BOOL, 'ascending', None, None, ), # 3\n    (4, TType.STRING, 'publicDescription', None, None, ), # 4\n  )\n\n  def __init__(self, uri=None, order=None, ascending=None, publicDescription=None,):\n    self.uri = uri\n    self.order = order\n    self.ascending = ascending\n    self.publicDescription = publicDescription\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.uri = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I32:\n          self.order = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.BOOL:\n          self.ascending = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.publicDescription = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('Publishing')\n    if self.uri is not None:\n      oprot.writeFieldBegin('uri', TType.STRING, 1)\n      oprot.writeString(self.uri)\n      oprot.writeFieldEnd()\n    if self.order is not None:\n      oprot.writeFieldBegin('order', TType.I32, 2)\n      oprot.writeI32(self.order)\n      oprot.writeFieldEnd()\n    if self.ascending is not None:\n      oprot.writeFieldBegin('ascending', TType.BOOL, 3)\n      oprot.writeBool(self.ascending)\n      oprot.writeFieldEnd()\n    if self.publicDescription is not None:\n      oprot.writeFieldBegin('publicDescription', TType.STRING, 4)\n      oprot.writeString(self.publicDescription)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass BusinessNotebook(object):\n  \"\"\"\n  If a Notebook contained in an Evernote Business account has been published\n  the to business library, the Notebook will have a reference to one of these\n  structures, which specifies how the Notebook will be represented in the\n  library.\n  \n  <dl>\n  <dt>notebookDescription</dt>\n    <dd>A short description of the notebook's content that will be displayed\n        in the business library user interface. The description may not begin\n        or end with whitespace.\n    <br/>\n    Length: EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MIN -\n            EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MAX\n    <br/>\n    Regex:  EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_REGEX\n    </dd>\n  \n  <dt>privilege</dt>\n    <dd>The privileges that will be granted to users who join the notebook through\n        the business library.\n    </dd>\n  \n  <dt>recommended</dt>\n    <dd>Whether the notebook should be \"recommended\" when displayed in the business\n        library user interface.\n    </dd>\n  </dl>\n  \n  Attributes:\n   - notebookDescription\n   - privilege\n   - recommended\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'notebookDescription', None, None, ), # 1\n    (2, TType.I32, 'privilege', None, None, ), # 2\n    (3, TType.BOOL, 'recommended', None, None, ), # 3\n  )\n\n  def __init__(self, notebookDescription=None, privilege=None, recommended=None,):\n    self.notebookDescription = notebookDescription\n    self.privilege = privilege\n    self.recommended = recommended\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.notebookDescription = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I32:\n          self.privilege = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.BOOL:\n          self.recommended = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('BusinessNotebook')\n    if self.notebookDescription is not None:\n      oprot.writeFieldBegin('notebookDescription', TType.STRING, 1)\n      oprot.writeString(self.notebookDescription)\n      oprot.writeFieldEnd()\n    if self.privilege is not None:\n      oprot.writeFieldBegin('privilege', TType.I32, 2)\n      oprot.writeI32(self.privilege)\n      oprot.writeFieldEnd()\n    if self.recommended is not None:\n      oprot.writeFieldBegin('recommended', TType.BOOL, 3)\n      oprot.writeBool(self.recommended)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass SavedSearchScope(object):\n  \"\"\"\n  A structure defining the scope of a SavedSearch.\n  \n  <dl>\n    <dt>includeAccount</dt>\n    <dd>The search should include notes from the account that contains the SavedSearch.</dd>\n  \n    <dt>includePersonalLinkedNotebooks</dt>\n    <dd>The search should include notes within those shared notebooks\n    that the user has joined that are NOT business notebooks.</dd>\n  \n    <dt>includeBusinessLinkedNotebooks</dt>\n    <dd>The search should include notes within those shared notebooks\n    that the user has joined that are business notebooks in the business that\n    the user is currently a member of.</dd>\n  </dl>\n  \n  Attributes:\n   - includeAccount\n   - includePersonalLinkedNotebooks\n   - includeBusinessLinkedNotebooks\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.BOOL, 'includeAccount', None, None, ), # 1\n    (2, TType.BOOL, 'includePersonalLinkedNotebooks', None, None, ), # 2\n    (3, TType.BOOL, 'includeBusinessLinkedNotebooks', None, None, ), # 3\n  )\n\n  def __init__(self, includeAccount=None, includePersonalLinkedNotebooks=None, includeBusinessLinkedNotebooks=None,):\n    self.includeAccount = includeAccount\n    self.includePersonalLinkedNotebooks = includePersonalLinkedNotebooks\n    self.includeBusinessLinkedNotebooks = includeBusinessLinkedNotebooks\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.BOOL:\n          self.includeAccount = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.BOOL:\n          self.includePersonalLinkedNotebooks = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.BOOL:\n          self.includeBusinessLinkedNotebooks = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('SavedSearchScope')\n    if self.includeAccount is not None:\n      oprot.writeFieldBegin('includeAccount', TType.BOOL, 1)\n      oprot.writeBool(self.includeAccount)\n      oprot.writeFieldEnd()\n    if self.includePersonalLinkedNotebooks is not None:\n      oprot.writeFieldBegin('includePersonalLinkedNotebooks', TType.BOOL, 2)\n      oprot.writeBool(self.includePersonalLinkedNotebooks)\n      oprot.writeFieldEnd()\n    if self.includeBusinessLinkedNotebooks is not None:\n      oprot.writeFieldBegin('includeBusinessLinkedNotebooks', TType.BOOL, 3)\n      oprot.writeBool(self.includeBusinessLinkedNotebooks)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass SavedSearch(object):\n  \"\"\"\n  A named search associated with the account that can be quickly re-used.\n  <dl>\n  <dt>guid</dt>\n    <dd>The unique identifier of this search.  Will be set by the\n    service, so may be omitted by the client when creating.\n    <br/>\n    Length:  EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX\n    <br/>\n    Regex:  EDAM_GUID_REGEX\n    </dd>\n  \n  <dt>name</dt>\n    <dd>The name of the saved search to display in the GUI.  The\n    account may only contain one search with a given name (case-insensitive\n    compare). Can't begin or end with a space.\n    <br/>\n    Length:  EDAM_SAVED_SEARCH_NAME_LEN_MIN - EDAM_SAVED_SEARCH_NAME_LEN_MAX\n    <br/>\n    Regex:  EDAM_SAVED_SEARCH_NAME_REGEX\n    </dd>\n  \n  <dt>query</dt>\n    <dd>A string expressing the search to be performed.\n    <br/>\n    Length:  EDAM_SAVED_SEARCH_QUERY_LEN_MIN - EDAM_SAVED_SEARCH_QUERY_LEN_MAX\n    </dd>\n  \n  <dt>format</dt>\n    <dd>The format of the query string, to determine how to parse\n    and process it.\n    </dd>\n  \n  <dt>updateSequenceNum</dt>\n    <dd>A number identifying the last transaction to\n    modify the state of this object.  The USN values are sequential within an\n    account, and can be used to compare the order of modifications within the\n    service.\n    </dd>\n  \n  <dt>scope</dt>\n    <dd><p>Specifies the set of notes that should be included in the search, if\n     possible.</p>\n     <p>Clients are expected to search as much of the desired scope as possible,\n     with the understanding that a given client may not be able to cover the full\n     specified scope. For example, when executing a search that includes notes in both\n     the owner's account and business notebooks, a mobile client may choose to only\n     search within the user's account because it is not capable of searching both\n     scopes simultaneously. When a search across multiple scopes is not possible,\n     a client may choose which scope to search based on the current application\n     context. If a client cannot search any of the desired scopes, it should refuse\n     to execute the search.</p>\n     </dd>\n  </dl>\n  \n  Attributes:\n   - guid\n   - name\n   - query\n   - format\n   - updateSequenceNum\n   - scope\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'guid', None, None, ), # 1\n    (2, TType.STRING, 'name', None, None, ), # 2\n    (3, TType.STRING, 'query', None, None, ), # 3\n    (4, TType.I32, 'format', None, None, ), # 4\n    (5, TType.I32, 'updateSequenceNum', None, None, ), # 5\n    (6, TType.STRUCT, 'scope', (SavedSearchScope, SavedSearchScope.thrift_spec), None, ), # 6\n  )\n\n  def __init__(self, guid=None, name=None, query=None, format=None, updateSequenceNum=None, scope=None,):\n    self.guid = guid\n    self.name = name\n    self.query = query\n    self.format = format\n    self.updateSequenceNum = updateSequenceNum\n    self.scope = scope\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.name = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.query = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.I32:\n          self.format = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.I32:\n          self.updateSequenceNum = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.STRUCT:\n          self.scope = SavedSearchScope()\n          self.scope.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('SavedSearch')\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 1)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.name is not None:\n      oprot.writeFieldBegin('name', TType.STRING, 2)\n      oprot.writeString(self.name)\n      oprot.writeFieldEnd()\n    if self.query is not None:\n      oprot.writeFieldBegin('query', TType.STRING, 3)\n      oprot.writeString(self.query)\n      oprot.writeFieldEnd()\n    if self.format is not None:\n      oprot.writeFieldBegin('format', TType.I32, 4)\n      oprot.writeI32(self.format)\n      oprot.writeFieldEnd()\n    if self.updateSequenceNum is not None:\n      oprot.writeFieldBegin('updateSequenceNum', TType.I32, 5)\n      oprot.writeI32(self.updateSequenceNum)\n      oprot.writeFieldEnd()\n    if self.scope is not None:\n      oprot.writeFieldBegin('scope', TType.STRUCT, 6)\n      self.scope.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass SharedNotebookRecipientSettings(object):\n  \"\"\"\n  Settings meant for the recipient of a shared notebook, such as\n  for indicating which types of notifications the recipient wishes\n  for reminders, etc.\n  \n  The reminderNotifyEmail and reminderNotifyInApp fields have a\n  3-state read value but a 2-state write value.  On read, it is\n  possible to observe \"unset\", true, or false.  The initial state is\n  \"unset\".  When you choose to set a value, you may set it to either\n  true or false, but you cannot unset the value.  Once one of these\n  members has a true/false value, it will always have a true/false\n  value.\n  \n  <dl>\n  <dt>reminderNotifyEmail</dt>\n  <dd>Indicates that the user wishes to receive daily e-mail notifications\n      for reminders associated with the shared notebook.  This may be\n      true only for business notebooks that belong to the business of\n      which the user is a member.  You may only set this value on a\n      notebook in your business.</dd>\n  <dt>reminderNotifyInApp</dt>\n  <dd>Indicates that the user wishes to receive notifications for\n      reminders by applications that support providing such\n      notifications.  The exact nature of the notification is defined\n      by the individual applications.</dd>\n  </dl>\n  \n  \n  Attributes:\n   - reminderNotifyEmail\n   - reminderNotifyInApp\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.BOOL, 'reminderNotifyEmail', None, None, ), # 1\n    (2, TType.BOOL, 'reminderNotifyInApp', None, None, ), # 2\n  )\n\n  def __init__(self, reminderNotifyEmail=None, reminderNotifyInApp=None,):\n    self.reminderNotifyEmail = reminderNotifyEmail\n    self.reminderNotifyInApp = reminderNotifyInApp\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.BOOL:\n          self.reminderNotifyEmail = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.BOOL:\n          self.reminderNotifyInApp = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('SharedNotebookRecipientSettings')\n    if self.reminderNotifyEmail is not None:\n      oprot.writeFieldBegin('reminderNotifyEmail', TType.BOOL, 1)\n      oprot.writeBool(self.reminderNotifyEmail)\n      oprot.writeFieldEnd()\n    if self.reminderNotifyInApp is not None:\n      oprot.writeFieldBegin('reminderNotifyInApp', TType.BOOL, 2)\n      oprot.writeBool(self.reminderNotifyInApp)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass SharedNotebook(object):\n  \"\"\"\n  Shared notebooks represent a relationship between a notebook and a single\n  share invitation recipient.\n  <dl>\n  <dt>id</dt>\n  <dd>the primary identifier of the share</dd>\n  \n  <dt>userId</dt>\n  <dd>the user id of the owner of the notebook</dd>\n  \n  <dt>notebookGuid</dt>\n  <dd>the GUID of the associated notebook shared.</dd>\n  \n  <dt>email</dt>\n  <dd>the email address of the recipient - used by the notebook\n  owner to identify who they shared with.</dd>\n  \n  <dt>notebookModifiable</dt>\n  <dd>(DEPRECATED) a flag indicating the share is read/write -otherwise it's read\n      only.  This field is deprecated in favor of the new \"privilege\" field.</dd>\n  \n  <dt>requireLogin</dt>\n  <dd>(DEPRECATED) indicates that a user must login to access the share.  This\n      field is deprecated and will be \"true\" for all new shared notebooks.  It\n      is read-only and ignored when creating or modifying a shared notebook,\n      except that a shared notebook can be modified to require login.\n      See \"allowPreview\" for information on privileges and shared notebooks.</dd>\n  \n  <dt>serviceCreated</dt>\n  <dd>the date the owner first created the share with the specific email\n    address</dd>\n  \n  <dt>serviceUpdated</dt>\n  <dd>the date the shared notebook was last updated on the service.  This\n      will be updated when authenticateToSharedNotebook is called the first\n      time with a shared notebook requiring login (i.e. when the username is\n      bound to that shared notebook).</dd>\n  \n  <dt>username</dt>\n  <dd>the username of the user who can access this share.\n    Once it's assigned it cannot be changed.</dd>\n  \n  <dt>privilege</dt>\n  <dd>The privilege level granted to the notebook, activity stream, and\n      invitations.  See the corresponding enumeration for details.</dd>\n  \n  <dt>allowPreview</dt>\n  <dd>Whether or not to grant \"READ_NOTEBOOK\" privilege without an\n      authentication token, for authenticateToSharedNotebook(...).  With\n      the change to \"requireLogin\" always being true for new shared\n      notebooks, this is the only way to access a shared notebook without\n      an authorization token.  This setting expires after the first use\n      of authenticateToSharedNotebook(...) with a valid authentication\n      token.</dd>\n  \n  <dt>recipientSettings</dt>\n  <dd>Settings intended for use only by the recipient of this shared\n      notebook.  You should skip setting this value unless you want\n      to change the value contained inside the structure, and only if\n      you are the recipient.</dd>\n  </dl>\n  \n  Attributes:\n   - id\n   - userId\n   - notebookGuid\n   - email\n   - notebookModifiable\n   - requireLogin\n   - serviceCreated\n   - serviceUpdated\n   - shareKey\n   - username\n   - privilege\n   - allowPreview\n   - recipientSettings\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I64, 'id', None, None, ), # 1\n    (2, TType.I32, 'userId', None, None, ), # 2\n    (3, TType.STRING, 'notebookGuid', None, None, ), # 3\n    (4, TType.STRING, 'email', None, None, ), # 4\n    (5, TType.BOOL, 'notebookModifiable', None, None, ), # 5\n    (6, TType.BOOL, 'requireLogin', None, None, ), # 6\n    (7, TType.I64, 'serviceCreated', None, None, ), # 7\n    (8, TType.STRING, 'shareKey', None, None, ), # 8\n    (9, TType.STRING, 'username', None, None, ), # 9\n    (10, TType.I64, 'serviceUpdated', None, None, ), # 10\n    (11, TType.I32, 'privilege', None, None, ), # 11\n    (12, TType.BOOL, 'allowPreview', None, None, ), # 12\n    (13, TType.STRUCT, 'recipientSettings', (SharedNotebookRecipientSettings, SharedNotebookRecipientSettings.thrift_spec), None, ), # 13\n  )\n\n  def __init__(self, id=None, userId=None, notebookGuid=None, email=None, notebookModifiable=None, requireLogin=None, serviceCreated=None, serviceUpdated=None, shareKey=None, username=None, privilege=None, allowPreview=None, recipientSettings=None,):\n    self.id = id\n    self.userId = userId\n    self.notebookGuid = notebookGuid\n    self.email = email\n    self.notebookModifiable = notebookModifiable\n    self.requireLogin = requireLogin\n    self.serviceCreated = serviceCreated\n    self.serviceUpdated = serviceUpdated\n    self.shareKey = shareKey\n    self.username = username\n    self.privilege = privilege\n    self.allowPreview = allowPreview\n    self.recipientSettings = recipientSettings\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I64:\n          self.id = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I32:\n          self.userId = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.notebookGuid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.email = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.notebookModifiable = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.BOOL:\n          self.requireLogin = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.I64:\n          self.serviceCreated = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.I64:\n          self.serviceUpdated = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.STRING:\n          self.shareKey = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.STRING:\n          self.username = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.I32:\n          self.privilege = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.BOOL:\n          self.allowPreview = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 13:\n        if ftype == TType.STRUCT:\n          self.recipientSettings = SharedNotebookRecipientSettings()\n          self.recipientSettings.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('SharedNotebook')\n    if self.id is not None:\n      oprot.writeFieldBegin('id', TType.I64, 1)\n      oprot.writeI64(self.id)\n      oprot.writeFieldEnd()\n    if self.userId is not None:\n      oprot.writeFieldBegin('userId', TType.I32, 2)\n      oprot.writeI32(self.userId)\n      oprot.writeFieldEnd()\n    if self.notebookGuid is not None:\n      oprot.writeFieldBegin('notebookGuid', TType.STRING, 3)\n      oprot.writeString(self.notebookGuid)\n      oprot.writeFieldEnd()\n    if self.email is not None:\n      oprot.writeFieldBegin('email', TType.STRING, 4)\n      oprot.writeString(self.email)\n      oprot.writeFieldEnd()\n    if self.notebookModifiable is not None:\n      oprot.writeFieldBegin('notebookModifiable', TType.BOOL, 5)\n      oprot.writeBool(self.notebookModifiable)\n      oprot.writeFieldEnd()\n    if self.requireLogin is not None:\n      oprot.writeFieldBegin('requireLogin', TType.BOOL, 6)\n      oprot.writeBool(self.requireLogin)\n      oprot.writeFieldEnd()\n    if self.serviceCreated is not None:\n      oprot.writeFieldBegin('serviceCreated', TType.I64, 7)\n      oprot.writeI64(self.serviceCreated)\n      oprot.writeFieldEnd()\n    if self.shareKey is not None:\n      oprot.writeFieldBegin('shareKey', TType.STRING, 8)\n      oprot.writeString(self.shareKey)\n      oprot.writeFieldEnd()\n    if self.username is not None:\n      oprot.writeFieldBegin('username', TType.STRING, 9)\n      oprot.writeString(self.username)\n      oprot.writeFieldEnd()\n    if self.serviceUpdated is not None:\n      oprot.writeFieldBegin('serviceUpdated', TType.I64, 10)\n      oprot.writeI64(self.serviceUpdated)\n      oprot.writeFieldEnd()\n    if self.privilege is not None:\n      oprot.writeFieldBegin('privilege', TType.I32, 11)\n      oprot.writeI32(self.privilege)\n      oprot.writeFieldEnd()\n    if self.allowPreview is not None:\n      oprot.writeFieldBegin('allowPreview', TType.BOOL, 12)\n      oprot.writeBool(self.allowPreview)\n      oprot.writeFieldEnd()\n    if self.recipientSettings is not None:\n      oprot.writeFieldBegin('recipientSettings', TType.STRUCT, 13)\n      self.recipientSettings.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass NotebookRestrictions(object):\n  \"\"\"\n  This structure captures information about the types of operations\n  that cannot be performed on a given notebook with a type of\n  authenticated access and credentials.  The values filled into this\n  structure are based on then-current values in the server database\n  for shared notebooks and notebook publishing records, as well as\n  information related to the authentication token.  Information from\n  the authentication token includes the application that is accessing\n  the server, as defined by the permissions granted by consumer (api)\n  key, and the method used to obtain the token, for example via\n  authenticateToSharedNotebook, authenticateToBusiness, etc.  Note\n  that changes to values in this structure that are the result of\n  shared notebook or publishing record changes are communicated to\n  the client via a change in the notebook USN during sync.  It is\n  important to use the same access method, parameters, and consumer\n  key in order obtain correct results from the sync engine.\n  \n  The server has the final say on what is allowed as values may\n  change between calls to obtain NotebookRestrictions instances\n  and to operate on data on the service.\n  \n  If the following are set and true, then the given restriction is\n  in effect, as accessed by the same authentication token from which\n  the values were obtained.\n  \n  <dt>noReadNotes</dt>\n    <dd>The client is not able to read notes from the service and\n    the notebook is write-only.\n    </dd>\n  <dt>noCreateNotes</dt>\n    <dd>The client may not create new notes in the notebook.\n    </dd>\n  <dt>noUpdateNotes</dt>\n    <dd>The client may not update notes currently in the notebook.\n    </dd>\n  <dt>noExpungeNotes</dt>\n    <dd>The client may not expunge notes currently in the notebook.\n    </dd>\n  <dt>noShareNotes</dt>\n    <dd>The client may not share notes in the notebook via the\n    shareNote method.\n    </dd>\n  <dt>noEmailNotes</dt>\n    <dd>The client may not e-mail notes via the Evernote service by\n    using the emailNote method.\n    </dd>\n  <dt>noSendMessageToRecipients</dt>\n    <dd>The client may not send messages to the share recipients of\n    the notebook.\n    </dd>\n  <dt>noUpdateNotebook</dt>\n    <dd>The client may not update the Notebook object itself, for\n    example, via the updateNotebook method.\n    </dd>\n  <dt>noExpungeNotebook</dt>\n    <dd>The client may not expunge the Notebook object itself, for\n    example, via the expungeNotebook method.\n    </dd>\n  <dt>noSetDefaultNotebook</dt>\n    <dd>The client may not set this notebook to be the default notebook.\n    The caller should leave Notebook.defaultNotebook unset.\n    </dd>\n  <dt>noSetNotebookStack</dt>\n    <dd>If the client is able to update the Notebook, the Notebook.stack\n    value may not be set.\n    </dd>\n  <dt>noPublishToPublic</dt>\n    <dd>The client may not change the publish the notebook to the public.\n    For example, business notebooks may not be shared publicly.\n    </dd>\n  <dt>noPublishToBusinessLibrary</dt>\n    <dd>The client may not publish the notebook to the business library.\n    </dd>\n  <dt>noCreateTags</dt>\n    <dd>The client may not complete an operation that results in a new tag\n    being created in the owner's account.\n    </dd>\n  <dt>noUpdateTags</dt>\n    <dd>The client may not update tags in the owner's account.\n    </dd>\n  <dt>noExpungeTags</dt>\n    <dd>The client may not expunge tags in the owner's account.\n    </dd>\n  <dt>noSetParentTag</dt>\n    <dd>If the client is able to create or update tags in the owner's account,\n    then they will not be able to set the parent tag.  Leave the value unset.\n    </dd>\n  <dt>noCreateSharedNotebooks</dt>\n    <dd>The client is unable to create shared notebooks for the notebook.\n    </dd>\n  <dt>updateWhichSharedNotebookRestrictions</dt>\n    <dd>Restrictions on which shared notebook instances can be updated.  If the\n    value is not set or null, then the client can update any of the shared notebooks\n    associated with the notebook on which the NotebookRestrictions are defined.\n    See the enumeration for further details.\n    </dd>\n  <dt>expungeWhichSharedNotebookRestrictions</dt>\n    <dd>Restrictions on which shared notebook instances can be expunged.  If the\n    value is not set or null, then the client can expunge any of the shared notebooks\n    associated with the notebook on which the NotebookRestrictions are defined.\n    See the enumeration for further details.\n    </dd>\n  \n  Attributes:\n   - noReadNotes\n   - noCreateNotes\n   - noUpdateNotes\n   - noExpungeNotes\n   - noShareNotes\n   - noEmailNotes\n   - noSendMessageToRecipients\n   - noUpdateNotebook\n   - noExpungeNotebook\n   - noSetDefaultNotebook\n   - noSetNotebookStack\n   - noPublishToPublic\n   - noPublishToBusinessLibrary\n   - noCreateTags\n   - noUpdateTags\n   - noExpungeTags\n   - noSetParentTag\n   - noCreateSharedNotebooks\n   - updateWhichSharedNotebookRestrictions\n   - expungeWhichSharedNotebookRestrictions\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.BOOL, 'noReadNotes', None, None, ), # 1\n    (2, TType.BOOL, 'noCreateNotes', None, None, ), # 2\n    (3, TType.BOOL, 'noUpdateNotes', None, None, ), # 3\n    (4, TType.BOOL, 'noExpungeNotes', None, None, ), # 4\n    (5, TType.BOOL, 'noShareNotes', None, None, ), # 5\n    (6, TType.BOOL, 'noEmailNotes', None, None, ), # 6\n    (7, TType.BOOL, 'noSendMessageToRecipients', None, None, ), # 7\n    (8, TType.BOOL, 'noUpdateNotebook', None, None, ), # 8\n    (9, TType.BOOL, 'noExpungeNotebook', None, None, ), # 9\n    (10, TType.BOOL, 'noSetDefaultNotebook', None, None, ), # 10\n    (11, TType.BOOL, 'noSetNotebookStack', None, None, ), # 11\n    (12, TType.BOOL, 'noPublishToPublic', None, None, ), # 12\n    (13, TType.BOOL, 'noPublishToBusinessLibrary', None, None, ), # 13\n    (14, TType.BOOL, 'noCreateTags', None, None, ), # 14\n    (15, TType.BOOL, 'noUpdateTags', None, None, ), # 15\n    (16, TType.BOOL, 'noExpungeTags', None, None, ), # 16\n    (17, TType.BOOL, 'noSetParentTag', None, None, ), # 17\n    (18, TType.BOOL, 'noCreateSharedNotebooks', None, None, ), # 18\n    (19, TType.I32, 'updateWhichSharedNotebookRestrictions', None, None, ), # 19\n    (20, TType.I32, 'expungeWhichSharedNotebookRestrictions', None, None, ), # 20\n  )\n\n  def __init__(self, noReadNotes=None, noCreateNotes=None, noUpdateNotes=None, noExpungeNotes=None, noShareNotes=None, noEmailNotes=None, noSendMessageToRecipients=None, noUpdateNotebook=None, noExpungeNotebook=None, noSetDefaultNotebook=None, noSetNotebookStack=None, noPublishToPublic=None, noPublishToBusinessLibrary=None, noCreateTags=None, noUpdateTags=None, noExpungeTags=None, noSetParentTag=None, noCreateSharedNotebooks=None, updateWhichSharedNotebookRestrictions=None, expungeWhichSharedNotebookRestrictions=None,):\n    self.noReadNotes = noReadNotes\n    self.noCreateNotes = noCreateNotes\n    self.noUpdateNotes = noUpdateNotes\n    self.noExpungeNotes = noExpungeNotes\n    self.noShareNotes = noShareNotes\n    self.noEmailNotes = noEmailNotes\n    self.noSendMessageToRecipients = noSendMessageToRecipients\n    self.noUpdateNotebook = noUpdateNotebook\n    self.noExpungeNotebook = noExpungeNotebook\n    self.noSetDefaultNotebook = noSetDefaultNotebook\n    self.noSetNotebookStack = noSetNotebookStack\n    self.noPublishToPublic = noPublishToPublic\n    self.noPublishToBusinessLibrary = noPublishToBusinessLibrary\n    self.noCreateTags = noCreateTags\n    self.noUpdateTags = noUpdateTags\n    self.noExpungeTags = noExpungeTags\n    self.noSetParentTag = noSetParentTag\n    self.noCreateSharedNotebooks = noCreateSharedNotebooks\n    self.updateWhichSharedNotebookRestrictions = updateWhichSharedNotebookRestrictions\n    self.expungeWhichSharedNotebookRestrictions = expungeWhichSharedNotebookRestrictions\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.BOOL:\n          self.noReadNotes = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.BOOL:\n          self.noCreateNotes = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.BOOL:\n          self.noUpdateNotes = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.BOOL:\n          self.noExpungeNotes = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.noShareNotes = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.BOOL:\n          self.noEmailNotes = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.BOOL:\n          self.noSendMessageToRecipients = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.BOOL:\n          self.noUpdateNotebook = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.BOOL:\n          self.noExpungeNotebook = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.BOOL:\n          self.noSetDefaultNotebook = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.BOOL:\n          self.noSetNotebookStack = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.BOOL:\n          self.noPublishToPublic = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 13:\n        if ftype == TType.BOOL:\n          self.noPublishToBusinessLibrary = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 14:\n        if ftype == TType.BOOL:\n          self.noCreateTags = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 15:\n        if ftype == TType.BOOL:\n          self.noUpdateTags = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 16:\n        if ftype == TType.BOOL:\n          self.noExpungeTags = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 17:\n        if ftype == TType.BOOL:\n          self.noSetParentTag = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 18:\n        if ftype == TType.BOOL:\n          self.noCreateSharedNotebooks = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 19:\n        if ftype == TType.I32:\n          self.updateWhichSharedNotebookRestrictions = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 20:\n        if ftype == TType.I32:\n          self.expungeWhichSharedNotebookRestrictions = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('NotebookRestrictions')\n    if self.noReadNotes is not None:\n      oprot.writeFieldBegin('noReadNotes', TType.BOOL, 1)\n      oprot.writeBool(self.noReadNotes)\n      oprot.writeFieldEnd()\n    if self.noCreateNotes is not None:\n      oprot.writeFieldBegin('noCreateNotes', TType.BOOL, 2)\n      oprot.writeBool(self.noCreateNotes)\n      oprot.writeFieldEnd()\n    if self.noUpdateNotes is not None:\n      oprot.writeFieldBegin('noUpdateNotes', TType.BOOL, 3)\n      oprot.writeBool(self.noUpdateNotes)\n      oprot.writeFieldEnd()\n    if self.noExpungeNotes is not None:\n      oprot.writeFieldBegin('noExpungeNotes', TType.BOOL, 4)\n      oprot.writeBool(self.noExpungeNotes)\n      oprot.writeFieldEnd()\n    if self.noShareNotes is not None:\n      oprot.writeFieldBegin('noShareNotes', TType.BOOL, 5)\n      oprot.writeBool(self.noShareNotes)\n      oprot.writeFieldEnd()\n    if self.noEmailNotes is not None:\n      oprot.writeFieldBegin('noEmailNotes', TType.BOOL, 6)\n      oprot.writeBool(self.noEmailNotes)\n      oprot.writeFieldEnd()\n    if self.noSendMessageToRecipients is not None:\n      oprot.writeFieldBegin('noSendMessageToRecipients', TType.BOOL, 7)\n      oprot.writeBool(self.noSendMessageToRecipients)\n      oprot.writeFieldEnd()\n    if self.noUpdateNotebook is not None:\n      oprot.writeFieldBegin('noUpdateNotebook', TType.BOOL, 8)\n      oprot.writeBool(self.noUpdateNotebook)\n      oprot.writeFieldEnd()\n    if self.noExpungeNotebook is not None:\n      oprot.writeFieldBegin('noExpungeNotebook', TType.BOOL, 9)\n      oprot.writeBool(self.noExpungeNotebook)\n      oprot.writeFieldEnd()\n    if self.noSetDefaultNotebook is not None:\n      oprot.writeFieldBegin('noSetDefaultNotebook', TType.BOOL, 10)\n      oprot.writeBool(self.noSetDefaultNotebook)\n      oprot.writeFieldEnd()\n    if self.noSetNotebookStack is not None:\n      oprot.writeFieldBegin('noSetNotebookStack', TType.BOOL, 11)\n      oprot.writeBool(self.noSetNotebookStack)\n      oprot.writeFieldEnd()\n    if self.noPublishToPublic is not None:\n      oprot.writeFieldBegin('noPublishToPublic', TType.BOOL, 12)\n      oprot.writeBool(self.noPublishToPublic)\n      oprot.writeFieldEnd()\n    if self.noPublishToBusinessLibrary is not None:\n      oprot.writeFieldBegin('noPublishToBusinessLibrary', TType.BOOL, 13)\n      oprot.writeBool(self.noPublishToBusinessLibrary)\n      oprot.writeFieldEnd()\n    if self.noCreateTags is not None:\n      oprot.writeFieldBegin('noCreateTags', TType.BOOL, 14)\n      oprot.writeBool(self.noCreateTags)\n      oprot.writeFieldEnd()\n    if self.noUpdateTags is not None:\n      oprot.writeFieldBegin('noUpdateTags', TType.BOOL, 15)\n      oprot.writeBool(self.noUpdateTags)\n      oprot.writeFieldEnd()\n    if self.noExpungeTags is not None:\n      oprot.writeFieldBegin('noExpungeTags', TType.BOOL, 16)\n      oprot.writeBool(self.noExpungeTags)\n      oprot.writeFieldEnd()\n    if self.noSetParentTag is not None:\n      oprot.writeFieldBegin('noSetParentTag', TType.BOOL, 17)\n      oprot.writeBool(self.noSetParentTag)\n      oprot.writeFieldEnd()\n    if self.noCreateSharedNotebooks is not None:\n      oprot.writeFieldBegin('noCreateSharedNotebooks', TType.BOOL, 18)\n      oprot.writeBool(self.noCreateSharedNotebooks)\n      oprot.writeFieldEnd()\n    if self.updateWhichSharedNotebookRestrictions is not None:\n      oprot.writeFieldBegin('updateWhichSharedNotebookRestrictions', TType.I32, 19)\n      oprot.writeI32(self.updateWhichSharedNotebookRestrictions)\n      oprot.writeFieldEnd()\n    if self.expungeWhichSharedNotebookRestrictions is not None:\n      oprot.writeFieldBegin('expungeWhichSharedNotebookRestrictions', TType.I32, 20)\n      oprot.writeI32(self.expungeWhichSharedNotebookRestrictions)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass Notebook(object):\n  \"\"\"\n  A unique container for a set of notes.\n  <dl>\n  <dt>guid</dt>\n    <dd>The unique identifier of this notebook.\n    <br/>\n    Length:  EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX\n    <br/>\n    Regex:  EDAM_GUID_REGEX\n    </dd>\n  \n  <dt>name</dt>\n    <dd>A sequence of characters representing the name of the\n    notebook.  May be changed by clients, but the account may not contain two\n    notebooks with names that are equal via a case-insensitive comparison.\n    Can't begin or end with a space.\n    <br/>\n    Length:  EDAM_NOTEBOOK_NAME_LEN_MIN - EDAM_NOTEBOOK_NAME_LEN_MAX\n    <br/>\n    Regex:  EDAM_NOTEBOOK_NAME_REGEX\n    </dd>\n  \n  <dt>updateSequenceNum</dt>\n    <dd>A number identifying the last transaction to\n    modify the state of this object.  The USN values are sequential within an\n    account, and can be used to compare the order of modifications within the\n    service.\n    </dd>\n  \n  <dt>defaultNotebook</dt>\n    <dd>If true, this notebook should be used for new notes\n    whenever the user has not (or cannot) specify a desired target notebook.\n    For example, if a note is submitted via SMTP email.\n    The service will maintain at most one defaultNotebook per account.\n    If a second notebook is created or updated with defaultNotebook set to\n    true, the service will automatically update the prior notebook's\n    defaultNotebook field to false.  If the default notebook is deleted\n    (i.e. \"active\" set to false), the \"defaultNotebook\" field will be\n    set to false by the service.  If the account has no default notebook\n    set, the service will use the most recent notebook as the default.\n    </dd>\n  \n  <dt>serviceCreated</dt>\n    <dd>The time when this notebook was created on the\n    service. This will be set on the service during creation, and the service\n    will provide this value when it returns a Notebook to a client.\n    The service will ignore this value if it is sent by clients.\n    </dd>\n  \n  <dt>serviceUpdated</dt>\n    <dd>The time when this notebook was last modified on the\n    service.  This will be set on the service during creation, and the service\n    will provide this value when it returns a Notebook to a client.\n    The service will ignore this value if it is sent by clients.\n    </dd>\n  \n  <dt>publishing</dt>\n    <dd>If the Notebook has been opened for public access, or\n    business users shared with their business (i.e. if 'published' is\n    set to true), then this will point to the set of publishing\n    information for the Notebook (URI, description, etc.).  A\n    Notebook cannot be published without providing this information,\n    but it will persist for later use if publishing is ever disabled\n    on the Notebook.  Clients that do not wish to change the\n    publishing behavior of a Notebook should not set this value when\n    calling NoteStore.updateNotebook().\n    </dd>\n  \n  <dt>published</dt>\n    <dd>If this is set to true, then the Notebook will be\n    accessible either to the public, or for business users to their business,\n    via the 'publishing' specification, which must also be set.  If this is set\n    to false, the Notebook will not be available to the public (or business).\n    Clients that do not wish to change the publishing behavior of a Notebook\n    should not set this value when calling NoteStore.updateNotebook().\n    </dd>\n  \n  <dt>stack</dt>\n    <dd>If this is set, then the notebook is visually contained within a stack\n    of notebooks with this name.  All notebooks in the same account with the\n    same 'stack' field are considered to be in the same stack.\n    Notebooks with no stack set are \"top level\" and not contained within a\n    stack.\n    </dd>\n  \n  <dt>sharedNotebookIds</dt>\n    <dd><i>DEPRECATED</i> - replaced by sharedNotebooks.</dd>\n  \n  <dt>sharedNotebooks</dt>\n    <dd>The list of recipients to whom this notebook has been shared\n    (one SharedNotebook object per recipient email address). This field will\n    be unset if you do not have permission to access this data. If you are\n    accessing the notebook as the owner or via a shared notebook that is\n    modifiable, then you have access to this data and the value will be set.\n    This field is read-only. Clients may not make changes to shared notebooks\n    via this field.\n    </dd>\n  \n  <dt>businessNotebook</dt>\n    <dd>If the notebook is part of a business account and has been published to the\n    business library, this will contain information for the library listing.\n    The presence or absence of this field is not a reliable test of whether a given\n    notebook is in fact a business notebook - the field is only used when a notebook is or\n    has been published to the business library.\n    </dd>\n  \n  <dt>contact</dt>\n    <dd>Intended for use with Business accounts, this field identifies the user who\n    has been designated as the \"contact\".  For notebooks created in business\n    accounts, the server will automatically set this value to the user who created\n    the notebook unless Notebook.contact.username has been set, in which that value\n    will be used.  When updating a notebook, it is common to leave Notebook.contact\n    field unset, indicating that no change to the value is being requested and that\n    the existing value, if any, should be preserved.\n    </dd>\n  \n  </dl>\n  \n  Attributes:\n   - guid\n   - name\n   - updateSequenceNum\n   - defaultNotebook\n   - serviceCreated\n   - serviceUpdated\n   - publishing\n   - published\n   - stack\n   - sharedNotebookIds\n   - sharedNotebooks\n   - businessNotebook\n   - contact\n   - restrictions\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'guid', None, None, ), # 1\n    (2, TType.STRING, 'name', None, None, ), # 2\n    None, # 3\n    None, # 4\n    (5, TType.I32, 'updateSequenceNum', None, None, ), # 5\n    (6, TType.BOOL, 'defaultNotebook', None, None, ), # 6\n    (7, TType.I64, 'serviceCreated', None, None, ), # 7\n    (8, TType.I64, 'serviceUpdated', None, None, ), # 8\n    None, # 9\n    (10, TType.STRUCT, 'publishing', (Publishing, Publishing.thrift_spec), None, ), # 10\n    (11, TType.BOOL, 'published', None, None, ), # 11\n    (12, TType.STRING, 'stack', None, None, ), # 12\n    (13, TType.LIST, 'sharedNotebookIds', (TType.I64,None), None, ), # 13\n    (14, TType.LIST, 'sharedNotebooks', (TType.STRUCT,(SharedNotebook, SharedNotebook.thrift_spec)), None, ), # 14\n    (15, TType.STRUCT, 'businessNotebook', (BusinessNotebook, BusinessNotebook.thrift_spec), None, ), # 15\n    (16, TType.STRUCT, 'contact', (User, User.thrift_spec), None, ), # 16\n    (17, TType.STRUCT, 'restrictions', (NotebookRestrictions, NotebookRestrictions.thrift_spec), None, ), # 17\n  )\n\n  def __init__(self, guid=None, name=None, updateSequenceNum=None, defaultNotebook=None, serviceCreated=None, serviceUpdated=None, publishing=None, published=None, stack=None, sharedNotebookIds=None, sharedNotebooks=None, businessNotebook=None, contact=None, restrictions=None,):\n    self.guid = guid\n    self.name = name\n    self.updateSequenceNum = updateSequenceNum\n    self.defaultNotebook = defaultNotebook\n    self.serviceCreated = serviceCreated\n    self.serviceUpdated = serviceUpdated\n    self.publishing = publishing\n    self.published = published\n    self.stack = stack\n    self.sharedNotebookIds = sharedNotebookIds\n    self.sharedNotebooks = sharedNotebooks\n    self.businessNotebook = businessNotebook\n    self.contact = contact\n    self.restrictions = restrictions\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.name = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.I32:\n          self.updateSequenceNum = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.BOOL:\n          self.defaultNotebook = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.I64:\n          self.serviceCreated = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.I64:\n          self.serviceUpdated = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.STRUCT:\n          self.publishing = Publishing()\n          self.publishing.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.BOOL:\n          self.published = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.STRING:\n          self.stack = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 13:\n        if ftype == TType.LIST:\n          self.sharedNotebookIds = []\n          (_etype63, _size60) = iprot.readListBegin()\n          for _i64 in xrange(_size60):\n            _elem65 = iprot.readI64();\n            self.sharedNotebookIds.append(_elem65)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 14:\n        if ftype == TType.LIST:\n          self.sharedNotebooks = []\n          (_etype69, _size66) = iprot.readListBegin()\n          for _i70 in xrange(_size66):\n            _elem71 = SharedNotebook()\n            _elem71.read(iprot)\n            self.sharedNotebooks.append(_elem71)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      elif fid == 15:\n        if ftype == TType.STRUCT:\n          self.businessNotebook = BusinessNotebook()\n          self.businessNotebook.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 16:\n        if ftype == TType.STRUCT:\n          self.contact = User()\n          self.contact.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 17:\n        if ftype == TType.STRUCT:\n          self.restrictions = NotebookRestrictions()\n          self.restrictions.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('Notebook')\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 1)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.name is not None:\n      oprot.writeFieldBegin('name', TType.STRING, 2)\n      oprot.writeString(self.name)\n      oprot.writeFieldEnd()\n    if self.updateSequenceNum is not None:\n      oprot.writeFieldBegin('updateSequenceNum', TType.I32, 5)\n      oprot.writeI32(self.updateSequenceNum)\n      oprot.writeFieldEnd()\n    if self.defaultNotebook is not None:\n      oprot.writeFieldBegin('defaultNotebook', TType.BOOL, 6)\n      oprot.writeBool(self.defaultNotebook)\n      oprot.writeFieldEnd()\n    if self.serviceCreated is not None:\n      oprot.writeFieldBegin('serviceCreated', TType.I64, 7)\n      oprot.writeI64(self.serviceCreated)\n      oprot.writeFieldEnd()\n    if self.serviceUpdated is not None:\n      oprot.writeFieldBegin('serviceUpdated', TType.I64, 8)\n      oprot.writeI64(self.serviceUpdated)\n      oprot.writeFieldEnd()\n    if self.publishing is not None:\n      oprot.writeFieldBegin('publishing', TType.STRUCT, 10)\n      self.publishing.write(oprot)\n      oprot.writeFieldEnd()\n    if self.published is not None:\n      oprot.writeFieldBegin('published', TType.BOOL, 11)\n      oprot.writeBool(self.published)\n      oprot.writeFieldEnd()\n    if self.stack is not None:\n      oprot.writeFieldBegin('stack', TType.STRING, 12)\n      oprot.writeString(self.stack)\n      oprot.writeFieldEnd()\n    if self.sharedNotebookIds is not None:\n      oprot.writeFieldBegin('sharedNotebookIds', TType.LIST, 13)\n      oprot.writeListBegin(TType.I64, len(self.sharedNotebookIds))\n      for iter72 in self.sharedNotebookIds:\n        oprot.writeI64(iter72)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.sharedNotebooks is not None:\n      oprot.writeFieldBegin('sharedNotebooks', TType.LIST, 14)\n      oprot.writeListBegin(TType.STRUCT, len(self.sharedNotebooks))\n      for iter73 in self.sharedNotebooks:\n        iter73.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    if self.businessNotebook is not None:\n      oprot.writeFieldBegin('businessNotebook', TType.STRUCT, 15)\n      self.businessNotebook.write(oprot)\n      oprot.writeFieldEnd()\n    if self.contact is not None:\n      oprot.writeFieldBegin('contact', TType.STRUCT, 16)\n      self.contact.write(oprot)\n      oprot.writeFieldEnd()\n    if self.restrictions is not None:\n      oprot.writeFieldBegin('restrictions', TType.STRUCT, 17)\n      self.restrictions.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass LinkedNotebook(object):\n  \"\"\"\n  A link in an users account that refers them to a public or individual share in\n  another user's account.\n  \n  <dl>\n  <dt>shareName</dt>\n  <dd>the display name of the shared notebook.\n    The link owner can change this.</dd>\n  \n  <dt>username</dt>\n  <dd>the username of the user who owns the shared or public notebook</dd>\n  \n  <dt>shardId</dt>\n  <dd>the shard ID of the notebook if the notebook is not public</dt>\n  \n  <dt>shareKey</dt>\n  <dd>the secret key that provides access to the shared notebook</dd>\n  \n  <dt>uri</dt>\n  <dd>the identifier of the public notebook</dd>\n  \n  <dt>guid</dt>\n    <dd>The unique identifier of this linked notebook.  Will be set whenever\n    a linked notebook is retrieved from the service, but may be null when a client\n    is creating a linked notebook.\n    <br/>\n    Length:  EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX\n    <br/>\n    Regex:  EDAM_GUID_REGEX\n    </dd>\n  \n  <dt>updateSequenceNum</dt>\n    <dd>A number identifying the last transaction to\n    modify the state of this object.  The USN values are sequential within an\n    account, and can be used to compare the order of modifications within the\n    service.\n    </dd>\n  \n  <dt>noteStoreUrl</dt>\n    <dd>\n    This field will contain the full URL that clients should use to make\n    NoteStore requests to the server shard that contains that notebook's data.\n    I.e. this is the URL that should be used to create the Thrift HTTP client\n    transport to send messages to the NoteStore service for the account.\n    </dd>\n  \n  <dt>webApiUrlPrefix:</dt>\n    <dd>\n    This field will contain the initial part of the URLs that should be used\n    to make requests to Evernote's thin client \"web API\", which provide\n    optimized operations for clients that aren't capable of manipulating\n    the full contents of accounts via the full Thrift data model. Clients\n    should concatenate the relative path for the various servlets onto the\n    end of this string to construct the full URL, as documented on our\n    developer web site.\n    </dd>\n  \n  <dt>stack</dt>\n    <dd>If this is set, then the notebook is visually contained within a stack\n    of notebooks with this name.  All notebooks in the same account with the\n    same 'stack' field are considered to be in the same stack.\n    Notebooks with no stack set are \"top level\" and not contained within a\n    stack.  The link owner can change this and this field is for the benefit\n    of the link owner.\n    </dd>\n  \n  <dt>businessId</dt>\n    <dd>If set, this will be the unique identifier for the business that owns\n    the notebook to which the linked notebook refers.\n  \n  </dl>\n  \n  Attributes:\n   - shareName\n   - username\n   - shardId\n   - shareKey\n   - uri\n   - guid\n   - updateSequenceNum\n   - noteStoreUrl\n   - webApiUrlPrefix\n   - stack\n   - businessId\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    None, # 1\n    (2, TType.STRING, 'shareName', None, None, ), # 2\n    (3, TType.STRING, 'username', None, None, ), # 3\n    (4, TType.STRING, 'shardId', None, None, ), # 4\n    (5, TType.STRING, 'shareKey', None, None, ), # 5\n    (6, TType.STRING, 'uri', None, None, ), # 6\n    (7, TType.STRING, 'guid', None, None, ), # 7\n    (8, TType.I32, 'updateSequenceNum', None, None, ), # 8\n    (9, TType.STRING, 'noteStoreUrl', None, None, ), # 9\n    (10, TType.STRING, 'webApiUrlPrefix', None, None, ), # 10\n    (11, TType.STRING, 'stack', None, None, ), # 11\n    (12, TType.I32, 'businessId', None, None, ), # 12\n  )\n\n  def __init__(self, shareName=None, username=None, shardId=None, shareKey=None, uri=None, guid=None, updateSequenceNum=None, noteStoreUrl=None, webApiUrlPrefix=None, stack=None, businessId=None,):\n    self.shareName = shareName\n    self.username = username\n    self.shardId = shardId\n    self.shareKey = shareKey\n    self.uri = uri\n    self.guid = guid\n    self.updateSequenceNum = updateSequenceNum\n    self.noteStoreUrl = noteStoreUrl\n    self.webApiUrlPrefix = webApiUrlPrefix\n    self.stack = stack\n    self.businessId = businessId\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 2:\n        if ftype == TType.STRING:\n          self.shareName = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.username = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.shardId = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.STRING:\n          self.shareKey = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.STRING:\n          self.uri = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.I32:\n          self.updateSequenceNum = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.STRING:\n          self.noteStoreUrl = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.STRING:\n          self.webApiUrlPrefix = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.STRING:\n          self.stack = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.I32:\n          self.businessId = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('LinkedNotebook')\n    if self.shareName is not None:\n      oprot.writeFieldBegin('shareName', TType.STRING, 2)\n      oprot.writeString(self.shareName)\n      oprot.writeFieldEnd()\n    if self.username is not None:\n      oprot.writeFieldBegin('username', TType.STRING, 3)\n      oprot.writeString(self.username)\n      oprot.writeFieldEnd()\n    if self.shardId is not None:\n      oprot.writeFieldBegin('shardId', TType.STRING, 4)\n      oprot.writeString(self.shardId)\n      oprot.writeFieldEnd()\n    if self.shareKey is not None:\n      oprot.writeFieldBegin('shareKey', TType.STRING, 5)\n      oprot.writeString(self.shareKey)\n      oprot.writeFieldEnd()\n    if self.uri is not None:\n      oprot.writeFieldBegin('uri', TType.STRING, 6)\n      oprot.writeString(self.uri)\n      oprot.writeFieldEnd()\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 7)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.updateSequenceNum is not None:\n      oprot.writeFieldBegin('updateSequenceNum', TType.I32, 8)\n      oprot.writeI32(self.updateSequenceNum)\n      oprot.writeFieldEnd()\n    if self.noteStoreUrl is not None:\n      oprot.writeFieldBegin('noteStoreUrl', TType.STRING, 9)\n      oprot.writeString(self.noteStoreUrl)\n      oprot.writeFieldEnd()\n    if self.webApiUrlPrefix is not None:\n      oprot.writeFieldBegin('webApiUrlPrefix', TType.STRING, 10)\n      oprot.writeString(self.webApiUrlPrefix)\n      oprot.writeFieldEnd()\n    if self.stack is not None:\n      oprot.writeFieldBegin('stack', TType.STRING, 11)\n      oprot.writeString(self.stack)\n      oprot.writeFieldEnd()\n    if self.businessId is not None:\n      oprot.writeFieldBegin('businessId', TType.I32, 12)\n      oprot.writeI32(self.businessId)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass NotebookDescriptor(object):\n  \"\"\"\n  A structure that describes a notebook or a user's relationship with\n  a notebook. NotebookDescriptor is expected to remain a lighter-weight\n  structure when compared to Notebook.\n  <dl>\n  <dt>guid</dt>\n    <dd>The unique identifier of the notebook.\n    </dd>\n  \n  <dt>notebookDisplayName</dt>\n    <dd>A sequence of characters representing the name of the\n    notebook.\n    </dd>\n  \n  <dt>contactName</dt>\n    <dd>The User.name value of the notebook's \"contact\".\n    </dd>\n  \n  <dt>hasSharedNotebook</dt>\n    <dd>Whether a SharedNotebook record exists between the calling user and this\n    notebook.\n    </dd>\n  \n  <dt>joinedUserCount</dt>\n    <dd>The number of users who have joined this notebook.\n    </dd>\n  \n  </dl>\n  \n  Attributes:\n   - guid\n   - notebookDisplayName\n   - contactName\n   - hasSharedNotebook\n   - joinedUserCount\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'guid', None, None, ), # 1\n    (2, TType.STRING, 'notebookDisplayName', None, None, ), # 2\n    (3, TType.STRING, 'contactName', None, None, ), # 3\n    (4, TType.BOOL, 'hasSharedNotebook', None, None, ), # 4\n    (5, TType.I32, 'joinedUserCount', None, None, ), # 5\n  )\n\n  def __init__(self, guid=None, notebookDisplayName=None, contactName=None, hasSharedNotebook=None, joinedUserCount=None,):\n    self.guid = guid\n    self.notebookDisplayName = notebookDisplayName\n    self.contactName = contactName\n    self.hasSharedNotebook = hasSharedNotebook\n    self.joinedUserCount = joinedUserCount\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.guid = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.notebookDisplayName = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.contactName = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.BOOL:\n          self.hasSharedNotebook = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.I32:\n          self.joinedUserCount = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('NotebookDescriptor')\n    if self.guid is not None:\n      oprot.writeFieldBegin('guid', TType.STRING, 1)\n      oprot.writeString(self.guid)\n      oprot.writeFieldEnd()\n    if self.notebookDisplayName is not None:\n      oprot.writeFieldBegin('notebookDisplayName', TType.STRING, 2)\n      oprot.writeString(self.notebookDisplayName)\n      oprot.writeFieldEnd()\n    if self.contactName is not None:\n      oprot.writeFieldBegin('contactName', TType.STRING, 3)\n      oprot.writeString(self.contactName)\n      oprot.writeFieldEnd()\n    if self.hasSharedNotebook is not None:\n      oprot.writeFieldBegin('hasSharedNotebook', TType.BOOL, 4)\n      oprot.writeBool(self.hasSharedNotebook)\n      oprot.writeFieldEnd()\n    if self.joinedUserCount is not None:\n      oprot.writeFieldBegin('joinedUserCount', TType.I32, 5)\n      oprot.writeI32(self.joinedUserCount)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n"
  },
  {
    "path": "lib/evernote/edam/userstore/UserStore-remote",
    "content": "#!/usr/bin/env python\n#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nimport sys\nimport pprint\nfrom urlparse import urlparse\nfrom thrift.transport import TTransport\nfrom thrift.transport import TSocket\nfrom thrift.transport import THttpClient\nfrom thrift.protocol import TBinaryProtocol\n\nimport UserStore\nfrom ttypes import *\n\nif len(sys.argv) <= 1 or sys.argv[1] == '--help':\n  print ''\n  print 'Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] function [arg1 [arg2...]]'\n  print ''\n  print 'Functions:'\n  print '  bool checkVersion(string clientName, i16 edamVersionMajor, i16 edamVersionMinor)'\n  print '  BootstrapInfo getBootstrapInfo(string locale)'\n  print '  AuthenticationResult authenticate(string username, string password, string consumerKey, string consumerSecret, bool supportsTwoFactor)'\n  print '  AuthenticationResult authenticateLongSession(string username, string password, string consumerKey, string consumerSecret, string deviceIdentifier, string deviceDescription, bool supportsTwoFactor)'\n  print '  AuthenticationResult completeTwoFactorAuthentication(string authenticationToken, string oneTimeCode, string deviceIdentifier, string deviceDescription)'\n  print '  void revokeLongSession(string authenticationToken)'\n  print '  AuthenticationResult authenticateToBusiness(string authenticationToken)'\n  print '  AuthenticationResult refreshAuthentication(string authenticationToken)'\n  print '  User getUser(string authenticationToken)'\n  print '  PublicUserInfo getPublicUserInfo(string username)'\n  print '  PremiumInfo getPremiumInfo(string authenticationToken)'\n  print '  string getNoteStoreUrl(string authenticationToken)'\n  print ''\n  sys.exit(0)\n\npp = pprint.PrettyPrinter(indent = 2)\nhost = 'localhost'\nport = 9090\nuri = ''\nframed = False\nhttp = False\nargi = 1\n\nif sys.argv[argi] == '-h':\n  parts = sys.argv[argi+1].split(':')\n  host = parts[0]\n  if len(parts) > 1:\n    port = int(parts[1])\n  argi += 2\n\nif sys.argv[argi] == '-u':\n  url = urlparse(sys.argv[argi+1])\n  parts = url[1].split(':')\n  host = parts[0]\n  if len(parts) > 1:\n    port = int(parts[1])\n  else:\n    port = 80\n  uri = url[2]\n  if url[4]:\n    uri += '?%s' % url[4]\n  http = True\n  argi += 2\n\nif sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':\n  framed = True\n  argi += 1\n\ncmd = sys.argv[argi]\nargs = sys.argv[argi+1:]\n\nif http:\n  transport = THttpClient.THttpClient(host, port, uri)\nelse:\n  socket = TSocket.TSocket(host, port)\n  if framed:\n    transport = TTransport.TFramedTransport(socket)\n  else:\n    transport = TTransport.TBufferedTransport(socket)\nprotocol = TBinaryProtocol.TBinaryProtocol(transport)\nclient = UserStore.Client(protocol)\ntransport.open()\n\nif cmd == 'checkVersion':\n  if len(args) != 3:\n    print 'checkVersion requires 3 args'\n    sys.exit(1)\n  pp.pprint(client.checkVersion(args[0],eval(args[1]),eval(args[2]),))\n\nelif cmd == 'getBootstrapInfo':\n  if len(args) != 1:\n    print 'getBootstrapInfo requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.getBootstrapInfo(args[0],))\n\nelif cmd == 'authenticate':\n  if len(args) != 5:\n    print 'authenticate requires 5 args'\n    sys.exit(1)\n  pp.pprint(client.authenticate(args[0],args[1],args[2],args[3],eval(args[4]),))\n\nelif cmd == 'authenticateLongSession':\n  if len(args) != 7:\n    print 'authenticateLongSession requires 7 args'\n    sys.exit(1)\n  pp.pprint(client.authenticateLongSession(args[0],args[1],args[2],args[3],args[4],args[5],eval(args[6]),))\n\nelif cmd == 'completeTwoFactorAuthentication':\n  if len(args) != 4:\n    print 'completeTwoFactorAuthentication requires 4 args'\n    sys.exit(1)\n  pp.pprint(client.completeTwoFactorAuthentication(args[0],args[1],args[2],args[3],))\n\nelif cmd == 'revokeLongSession':\n  if len(args) != 1:\n    print 'revokeLongSession requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.revokeLongSession(args[0],))\n\nelif cmd == 'authenticateToBusiness':\n  if len(args) != 1:\n    print 'authenticateToBusiness requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.authenticateToBusiness(args[0],))\n\nelif cmd == 'refreshAuthentication':\n  if len(args) != 1:\n    print 'refreshAuthentication requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.refreshAuthentication(args[0],))\n\nelif cmd == 'getUser':\n  if len(args) != 1:\n    print 'getUser requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.getUser(args[0],))\n\nelif cmd == 'getPublicUserInfo':\n  if len(args) != 1:\n    print 'getPublicUserInfo requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.getPublicUserInfo(args[0],))\n\nelif cmd == 'getPremiumInfo':\n  if len(args) != 1:\n    print 'getPremiumInfo requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.getPremiumInfo(args[0],))\n\nelif cmd == 'getNoteStoreUrl':\n  if len(args) != 1:\n    print 'getNoteStoreUrl requires 1 args'\n    sys.exit(1)\n  pp.pprint(client.getNoteStoreUrl(args[0],))\n\nelse:\n  print 'Unrecognized method %s' % cmd\n  sys.exit(1)\n\ntransport.close()\n"
  },
  {
    "path": "lib/evernote/edam/userstore/UserStore.py",
    "content": "#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nfrom ttypes import *\nfrom thrift.Thrift import TProcessor\nfrom thrift.transport import TTransport\nfrom thrift.protocol import TBinaryProtocol, TProtocol\ntry:\n  from thrift.protocol import fastbinary\nexcept:\n  fastbinary = None\n\n\nclass Iface(object):\n  \"\"\"\n  Service:  UserStore\n  <p>\n  The UserStore service is primarily used by EDAM clients to establish\n  authentication via username and password over a trusted connection (e.g.\n  SSL).  A client's first call to this interface should be checkVersion() to\n  ensure that the client's software is up to date.\n  </p>\n  All calls which require an authenticationToken may throw an\n  EDAMUserException for the following reasons:\n   <ul>\n    <li> AUTH_EXPIRED \"authenticationToken\" - token has expired\n    <li> BAD_DATA_FORMAT \"authenticationToken\" - token is malformed\n    <li> DATA_REQUIRED \"authenticationToken\" - token is empty\n    <li> INVALID_AUTH \"authenticationToken\" - token signature is invalid\n  </ul>\n  \"\"\"\n  def checkVersion(self, clientName, edamVersionMajor, edamVersionMinor):\n    \"\"\"\n    This should be the first call made by a client to the EDAM service.  It\n    tells the service what protocol version is used by the client.  The\n    service will then return true if the client is capable of talking to\n    the service, and false if the client's protocol version is incompatible\n    with the service, so the client must upgrade.  If a client receives a\n    false value, it should report the incompatibility to the user and not\n    continue with any more EDAM requests (UserStore or NoteStore).\n    \n    @param clientName\n      This string provides some information about the client for\n      tracking/logging on the service.  It should provide information about\n      the client's software and platform. The structure should be:\n      application/version; platform/version; [ device/version ]\n      E.g. \"Evernote Windows/3.0.1; Windows/XP SP3\".\n    \n    @param edamVersionMajor\n      This should be the major protocol version that was compiled by the\n      client.  This should be the current value of the EDAM_VERSION_MAJOR\n      constant for the client.\n    \n    @param edamVersionMinor\n      This should be the major protocol version that was compiled by the\n      client.  This should be the current value of the EDAM_VERSION_MINOR\n      constant for the client.\n    \n    Parameters:\n     - clientName\n     - edamVersionMajor\n     - edamVersionMinor\n    \"\"\"\n    pass\n\n  def getBootstrapInfo(self, locale):\n    \"\"\"\n    This provides bootstrap information to the client. Various bootstrap\n    profiles and settings may be used by the client to configure itself.\n    \n    @param locale\n      The client's current locale, expressed in language[_country]\n      format. E.g., \"en_US\". See ISO-639 and ISO-3166 for valid\n      language and country codes.\n    \n    @return\n      The bootstrap information suitable for this client.\n    \n    Parameters:\n     - locale\n    \"\"\"\n    pass\n\n  def authenticate(self, username, password, consumerKey, consumerSecret, supportsTwoFactor):\n    \"\"\"\n    This is used to check a username and password in order to create a\n    short-lived authentication session that can be used for further actions.\n    \n    This function is only available to Evernote's internal applications.\n    Third party applications must authenticate using OAuth as\n    described at\n    <a href=\"http://dev.evernote.com/documentation/cloud/\">dev.evernote.com</a>.\n    \n    @param username\n      The username (not numeric user ID) for the account to\n      authenticate against.  This function will also accept the user's\n      registered email address in this parameter.\n    \n    @param password\n      The plaintext password to check against the account.  Since\n      this is not protected by the EDAM protocol, this information must be\n      provided over a protected transport (e.g. SSL).\n    \n    @param consumerKey\n      The \"consumer key\" portion of the API key issued to the client application\n      by Evernote.\n    \n    @param consumerSecret\n      The \"consumer secret\" portion of the API key issued to the client application\n      by Evernote.\n    \n    @param supportsTwoFactor\n      Whether the calling application supports two-factor authentication. If this\n      parameter is false, this method will fail with the error code INVALID_AUTH and the\n      parameter \"password\" when called for a user who has enabled two-factor\n      authentication.\n    \n    @return\n      <p>The result of the authentication.  If the authentication was successful,\n      the AuthenticationResult.user field will be set with the full information\n      about the User.</p>\n      <p>If the user has two-factor authentication enabled,\n      AuthenticationResult.secondFactorRequired will be set and\n      AuthenticationResult.authenticationToken will contain a short-lived token\n      that may only be used to complete the two-factor authentication process by calling\n      UserStore.completeTwoFactorAuthentication.</p>\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"username\" - username is empty\n      <li> DATA_REQUIRED \"password\" - password is empty\n      <li> DATA_REQUIRED \"consumerKey\" - consumerKey is empty\n      <li> INVALID_AUTH \"username\" - username not found\n      <li> INVALID_AUTH \"password\" - password did not match\n      <li> INVALID_AUTH \"consumerKey\" - consumerKey is not authorized\n      <li> INVALID_AUTH \"consumerSecret\" - consumerSecret is incorrect\n      <li> PERMISSION_DENIED \"User.active\" - user account is closed\n      <li> PERMISSION_DENIED \"User.tooManyFailuresTryAgainLater\" - user has\n        failed authentication too often\n    </ul>\n    \n    Parameters:\n     - username\n     - password\n     - consumerKey\n     - consumerSecret\n     - supportsTwoFactor\n    \"\"\"\n    pass\n\n  def authenticateLongSession(self, username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor):\n    \"\"\"\n    This is used to check a username and password in order to create a\n    long-lived authentication token that can be used for further actions.\n    \n    This function is not available to most third party applications,\n    which typically authenticate using OAuth as\n    described at\n    <a href=\"http://dev.evernote.com/documentation/cloud/\">dev.evernote.com</a>.\n    If you believe that your application requires permission to authenticate\n    using username and password instead of OAuth, please contact Evernote\n    developer support by visiting\n    <a href=\"http://dev.evernote.com\">dev.evernote.com</a>.\n    \n    @param username\n      The username or registered email address of the account to\n      authenticate against.\n    \n    @param password\n      The plaintext password to check against the account.  Since\n      this is not protected by the EDAM protocol, this information must be\n      provided over a protected transport (i.e. SSL).\n    \n    @param consumerKey\n      The \"consumer key\" portion of the API key issued to the client application\n      by Evernote.\n    \n    @param consumerSecret\n      The \"consumer secret\" portion of the API key issued to the client application\n      by Evernote.\n    \n    @param deviceIdentifier\n      An optional string, no more than 32 characters in length, that uniquely identifies\n      the device from which the authentication is being performed. This string allows\n      the service to return the same authentication token when a given application\n      requests authentication repeatedly from the same device. This may happen when the\n      user logs out of an application and then logs back in, or when the application is\n      uninstalled and later reinstalled. If no reliable device identifier can be created,\n      this value should be omitted. If set, the device identifier must be between\n      1 and EDAM_DEVICE_ID_LEN_MAX characters long and must match the regular expression\n      EDAM_DEVICE_ID_REGEX.\n    \n    @param deviceDescription\n      A description of the device from which the authentication is being performed.\n      This field is displayed to the user in a list of authorized applications to\n      allow them to distinguish between multiple tokens issued to the same client\n      application on different devices. For example, the Evernote iOS client on\n      a user's iPhone and iPad might pass the iOS device names \"Bob's iPhone\" and\n      \"Bob's iPad\". The device description must be between 1 and\n      EDAM_DEVICE_DESCRIPTION_LEN_MAX characters long and must match the regular\n      expression EDAM_DEVICE_DESCRIPTION_REGEX.\n    \n    @param supportsTwoFactor\n      Whether the calling application supports two-factor authentication. If this\n      parameter is false, this method will fail with the error code INVALID_AUTH and the\n      parameter \"password\" when called for a user who has enabled two-factor\n      authentication.\n    \n    @return\n      <p>The result of the authentication. The level of detail provided in the returned\n      AuthenticationResult.User structure depends on the access level granted by\n      calling application's API key.</p>\n      <p>If the user has two-factor authentication enabled,\n      AuthenticationResult.secondFactorRequired will be set and\n      AuthenticationResult.authenticationToken will contain a short-lived token\n      that may only be used to complete the two-factor authentication process by calling\n      UserStore.completeTwoFactorAuthentication.</p>\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"username\" - username is empty\n      <li> DATA_REQUIRED \"password\" - password is empty\n      <li> DATA_REQUIRED \"consumerKey\" - consumerKey is empty\n      <li> DATA_REQUIRED \"consumerSecret\" - consumerSecret is empty\n      <li> DATA_REQUIRED \"deviceDescription\" - deviceDescription is empty\n      <li> BAD_DATA_FORMAT \"deviceDescription\" - deviceDescription is not valid.\n      <li> BAD_DATA_FORMAT \"deviceIdentifier\" - deviceIdentifier is not valid.\n      <li> INVALID_AUTH \"username\" - username not found\n      <li> INVALID_AUTH \"password\" - password did not match\n      <li> INVALID_AUTH \"consumerKey\" - consumerKey is not authorized\n      <li> INVALID_AUTH \"consumerSecret\" - consumerSecret is incorrect\n      <li> PERMISSION_DENIED \"User.active\" - user account is closed\n      <li> PERMISSION_DENIED \"User.tooManyFailuresTryAgainLater\" - user has\n        failed authentication too often\n    </ul>\n    \n    Parameters:\n     - username\n     - password\n     - consumerKey\n     - consumerSecret\n     - deviceIdentifier\n     - deviceDescription\n     - supportsTwoFactor\n    \"\"\"\n    pass\n\n  def completeTwoFactorAuthentication(self, authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription):\n    \"\"\"\n    Complete the authentication process when a second factor is required. This\n    call is made after a successful call to authenticate or authenticateLongSession\n    when the authenticating user has enabled two-factor authentication.\n    \n    @param authenticationToken An authentication token returned by a previous\n      call to UserStore.authenticate or UserStore.authenticateLongSession that\n      could not be completed in a single call because a second factor was required.\n    \n    @param oneTimeCode The one time code entered by the user. This value is delivered\n      out-of-band, typically via SMS or an authenticator application.\n    \n    @param deviceIdentifier See the corresponding parameter in authenticateLongSession.\n    \n    @param deviceDescription See the corresponding parameter in authenticateLongSession.\n    \n    @return\n      The result of the authentication. The level of detail provided in the returned\n      AuthenticationResult.User structure depends on the access level granted by the\n      calling application's API key. If the initial authentication call was made to\n      authenticateLongSession, the AuthenticationResult will contain a long-lived\n      authentication token.\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"authenticationToken\" - authenticationToken is empty\n      <li> DATA_REQUIRED \"oneTimeCode\" - oneTimeCode is empty\n      <li> BAD_DATA_FORMAT \"authenticationToken\" - authenticationToken is not well formed\n      <li> INVALID_AUTH \"oneTimeCode\" - oneTimeCode did not match\n      <li> AUTH_EXPIRED \"authenticationToken\" - authenticationToken has expired\n      <li> PERMISSION_DENIED \"authenticationToken\" - authenticationToken is not valid\n      <li> PERMISSION_DENIED \"User.active\" - user account is closed\n      <li> PERMISSION_DENIED \"User.tooManyFailuresTryAgainLater\" - user has\n        failed authentication too often\n      <li> DATA_CONFLICT \"User.twoFactorAuthentication\" - The user has not enabled\n         two-factor authentication.</li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - oneTimeCode\n     - deviceIdentifier\n     - deviceDescription\n    \"\"\"\n    pass\n\n  def revokeLongSession(self, authenticationToken):\n    \"\"\"\n    Revoke an existing long lived authentication token. This can be used to\n    revoke OAuth tokens or tokens created by calling authenticateLongSession,\n    and allows a user to effectively log out of Evernote from the perspective\n    of the application that holds the token. The authentication token that is\n    passed is immediately revoked and may not be used to call any authenticated\n    EDAM function.\n    \n    @param authenticationToken the authentication token to revoke.\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"authenticationToken\" - no authentication token provided\n      <li> BAD_DATA_FORMAT \"authenticationToken\" - the authentication token is not well formed\n      <li> INVALID_AUTH \"authenticationToken\" - the authentication token is invalid\n      <li> AUTH_EXPIRED \"authenticationToken\" - the authentication token is expired or\n        is already revoked.\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def authenticateToBusiness(self, authenticationToken):\n    \"\"\"\n    This is used to take an existing authentication token that grants access\n    to an individual user account (returned from 'authenticate',\n    'authenticateLongSession' or an OAuth authorization) and obtain an additional\n    authentication token that may be used to access business notebooks if the user\n    is a member of an Evernote Business account.\n    \n    The resulting authentication token may be used to make NoteStore API calls\n    against the business using the NoteStore URL returned in the result.\n    \n    @param authenticationToken\n      The authentication token for the user. This may not be a shared authentication\n      token (returned by NoteStore.authenticateToSharedNotebook or\n      NoteStore.authenticateToSharedNote) or a business authentication token.\n    \n    @return\n      The result of the authentication, with the token granting access to the\n      business in the result's 'authenticationToken' field. The URL that must\n      be used to access the business account NoteStore will be returned in the\n      result's 'noteStoreUrl' field.  The 'User' field will\n      not be set in the result.\n    \n    @throws EDAMUserException <ul>\n      <li> PERMISSION_DENIED \"authenticationToken\" - the provided authentication token\n           is a shared or business authentication token. </li>\n      <li> PERMISSION_DENIED \"Business\" - the user identified by the provided\n           authentication token is not currently a member of a business. </li>\n      <li> PERMISSION_DENIED \"Business.status\" - the business that the user is a\n           member of is not currently in an active status. </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def refreshAuthentication(self, authenticationToken):\n    \"\"\"\n    This is used to take an existing authentication token (returned from\n    'authenticate') and exchange it for a newer token which will not expire\n    as soon.  This must be invoked before the previous token expires.\n    \n    This function is only availabe to Evernote's internal applications.\n    \n    @param authenticationToken\n      The previous authentication token from the authenticate() result.\n    \n    @return\n      The result of the authentication, with the new token in\n      the result's 'authenticationToken' field.  The 'User' field will\n      not be set in the result.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def getUser(self, authenticationToken):\n    \"\"\"\n    Returns the User corresponding to the provided authentication token,\n    or throws an exception if this token is not valid.\n    The level of detail provided in the returned User structure depends on\n    the access level granted by the token, so a web service client may receive\n    fewer fields than an integrated desktop client.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def getPublicUserInfo(self, username):\n    \"\"\"\n    Asks the UserStore about the publicly available location information for\n    a particular username.\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"username\" - username is empty\n    </ul>\n    \n    Parameters:\n     - username\n    \"\"\"\n    pass\n\n  def getPremiumInfo(self, authenticationToken):\n    \"\"\"\n    Returns information regarding a user's Premium account corresponding to the\n    provided authentication token, or throws an exception if this token is not\n    valid.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n  def getNoteStoreUrl(self, authenticationToken):\n    \"\"\"\n    Returns the URL that should be used to talk to the NoteStore for the\n    account represented by the provided authenticationToken.\n    This method isn't needed by most clients, who can retrieve the correct\n    NoteStore URL from the AuthenticationResult returned from the authenticate\n    or refreshAuthentication calls. This method is typically only needed\n    to look up the correct URL for a long-lived session token (e.g. for an\n    OAuth web service).\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    pass\n\n\nclass Client(Iface):\n  \"\"\"\n  Service:  UserStore\n  <p>\n  The UserStore service is primarily used by EDAM clients to establish\n  authentication via username and password over a trusted connection (e.g.\n  SSL).  A client's first call to this interface should be checkVersion() to\n  ensure that the client's software is up to date.\n  </p>\n  All calls which require an authenticationToken may throw an\n  EDAMUserException for the following reasons:\n   <ul>\n    <li> AUTH_EXPIRED \"authenticationToken\" - token has expired\n    <li> BAD_DATA_FORMAT \"authenticationToken\" - token is malformed\n    <li> DATA_REQUIRED \"authenticationToken\" - token is empty\n    <li> INVALID_AUTH \"authenticationToken\" - token signature is invalid\n  </ul>\n  \"\"\"\n  def __init__(self, iprot, oprot=None):\n    self._iprot = self._oprot = iprot\n    if oprot is not None:\n      self._oprot = oprot\n    self._seqid = 0\n\n  def checkVersion(self, clientName, edamVersionMajor, edamVersionMinor):\n    \"\"\"\n    This should be the first call made by a client to the EDAM service.  It\n    tells the service what protocol version is used by the client.  The\n    service will then return true if the client is capable of talking to\n    the service, and false if the client's protocol version is incompatible\n    with the service, so the client must upgrade.  If a client receives a\n    false value, it should report the incompatibility to the user and not\n    continue with any more EDAM requests (UserStore or NoteStore).\n    \n    @param clientName\n      This string provides some information about the client for\n      tracking/logging on the service.  It should provide information about\n      the client's software and platform. The structure should be:\n      application/version; platform/version; [ device/version ]\n      E.g. \"Evernote Windows/3.0.1; Windows/XP SP3\".\n    \n    @param edamVersionMajor\n      This should be the major protocol version that was compiled by the\n      client.  This should be the current value of the EDAM_VERSION_MAJOR\n      constant for the client.\n    \n    @param edamVersionMinor\n      This should be the major protocol version that was compiled by the\n      client.  This should be the current value of the EDAM_VERSION_MINOR\n      constant for the client.\n    \n    Parameters:\n     - clientName\n     - edamVersionMajor\n     - edamVersionMinor\n    \"\"\"\n    self.send_checkVersion(clientName, edamVersionMajor, edamVersionMinor)\n    return self.recv_checkVersion()\n\n  def send_checkVersion(self, clientName, edamVersionMajor, edamVersionMinor):\n    self._oprot.writeMessageBegin('checkVersion', TMessageType.CALL, self._seqid)\n    args = checkVersion_args()\n    args.clientName = clientName\n    args.edamVersionMajor = edamVersionMajor\n    args.edamVersionMinor = edamVersionMinor\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_checkVersion(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = checkVersion_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"checkVersion failed: unknown result\");\n\n  def getBootstrapInfo(self, locale):\n    \"\"\"\n    This provides bootstrap information to the client. Various bootstrap\n    profiles and settings may be used by the client to configure itself.\n    \n    @param locale\n      The client's current locale, expressed in language[_country]\n      format. E.g., \"en_US\". See ISO-639 and ISO-3166 for valid\n      language and country codes.\n    \n    @return\n      The bootstrap information suitable for this client.\n    \n    Parameters:\n     - locale\n    \"\"\"\n    self.send_getBootstrapInfo(locale)\n    return self.recv_getBootstrapInfo()\n\n  def send_getBootstrapInfo(self, locale):\n    self._oprot.writeMessageBegin('getBootstrapInfo', TMessageType.CALL, self._seqid)\n    args = getBootstrapInfo_args()\n    args.locale = locale\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getBootstrapInfo(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getBootstrapInfo_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getBootstrapInfo failed: unknown result\");\n\n  def authenticate(self, username, password, consumerKey, consumerSecret, supportsTwoFactor):\n    \"\"\"\n    This is used to check a username and password in order to create a\n    short-lived authentication session that can be used for further actions.\n    \n    This function is only available to Evernote's internal applications.\n    Third party applications must authenticate using OAuth as\n    described at\n    <a href=\"http://dev.evernote.com/documentation/cloud/\">dev.evernote.com</a>.\n    \n    @param username\n      The username (not numeric user ID) for the account to\n      authenticate against.  This function will also accept the user's\n      registered email address in this parameter.\n    \n    @param password\n      The plaintext password to check against the account.  Since\n      this is not protected by the EDAM protocol, this information must be\n      provided over a protected transport (e.g. SSL).\n    \n    @param consumerKey\n      The \"consumer key\" portion of the API key issued to the client application\n      by Evernote.\n    \n    @param consumerSecret\n      The \"consumer secret\" portion of the API key issued to the client application\n      by Evernote.\n    \n    @param supportsTwoFactor\n      Whether the calling application supports two-factor authentication. If this\n      parameter is false, this method will fail with the error code INVALID_AUTH and the\n      parameter \"password\" when called for a user who has enabled two-factor\n      authentication.\n    \n    @return\n      <p>The result of the authentication.  If the authentication was successful,\n      the AuthenticationResult.user field will be set with the full information\n      about the User.</p>\n      <p>If the user has two-factor authentication enabled,\n      AuthenticationResult.secondFactorRequired will be set and\n      AuthenticationResult.authenticationToken will contain a short-lived token\n      that may only be used to complete the two-factor authentication process by calling\n      UserStore.completeTwoFactorAuthentication.</p>\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"username\" - username is empty\n      <li> DATA_REQUIRED \"password\" - password is empty\n      <li> DATA_REQUIRED \"consumerKey\" - consumerKey is empty\n      <li> INVALID_AUTH \"username\" - username not found\n      <li> INVALID_AUTH \"password\" - password did not match\n      <li> INVALID_AUTH \"consumerKey\" - consumerKey is not authorized\n      <li> INVALID_AUTH \"consumerSecret\" - consumerSecret is incorrect\n      <li> PERMISSION_DENIED \"User.active\" - user account is closed\n      <li> PERMISSION_DENIED \"User.tooManyFailuresTryAgainLater\" - user has\n        failed authentication too often\n    </ul>\n    \n    Parameters:\n     - username\n     - password\n     - consumerKey\n     - consumerSecret\n     - supportsTwoFactor\n    \"\"\"\n    self.send_authenticate(username, password, consumerKey, consumerSecret, supportsTwoFactor)\n    return self.recv_authenticate()\n\n  def send_authenticate(self, username, password, consumerKey, consumerSecret, supportsTwoFactor):\n    self._oprot.writeMessageBegin('authenticate', TMessageType.CALL, self._seqid)\n    args = authenticate_args()\n    args.username = username\n    args.password = password\n    args.consumerKey = consumerKey\n    args.consumerSecret = consumerSecret\n    args.supportsTwoFactor = supportsTwoFactor\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_authenticate(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = authenticate_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"authenticate failed: unknown result\");\n\n  def authenticateLongSession(self, username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor):\n    \"\"\"\n    This is used to check a username and password in order to create a\n    long-lived authentication token that can be used for further actions.\n    \n    This function is not available to most third party applications,\n    which typically authenticate using OAuth as\n    described at\n    <a href=\"http://dev.evernote.com/documentation/cloud/\">dev.evernote.com</a>.\n    If you believe that your application requires permission to authenticate\n    using username and password instead of OAuth, please contact Evernote\n    developer support by visiting\n    <a href=\"http://dev.evernote.com\">dev.evernote.com</a>.\n    \n    @param username\n      The username or registered email address of the account to\n      authenticate against.\n    \n    @param password\n      The plaintext password to check against the account.  Since\n      this is not protected by the EDAM protocol, this information must be\n      provided over a protected transport (i.e. SSL).\n    \n    @param consumerKey\n      The \"consumer key\" portion of the API key issued to the client application\n      by Evernote.\n    \n    @param consumerSecret\n      The \"consumer secret\" portion of the API key issued to the client application\n      by Evernote.\n    \n    @param deviceIdentifier\n      An optional string, no more than 32 characters in length, that uniquely identifies\n      the device from which the authentication is being performed. This string allows\n      the service to return the same authentication token when a given application\n      requests authentication repeatedly from the same device. This may happen when the\n      user logs out of an application and then logs back in, or when the application is\n      uninstalled and later reinstalled. If no reliable device identifier can be created,\n      this value should be omitted. If set, the device identifier must be between\n      1 and EDAM_DEVICE_ID_LEN_MAX characters long and must match the regular expression\n      EDAM_DEVICE_ID_REGEX.\n    \n    @param deviceDescription\n      A description of the device from which the authentication is being performed.\n      This field is displayed to the user in a list of authorized applications to\n      allow them to distinguish between multiple tokens issued to the same client\n      application on different devices. For example, the Evernote iOS client on\n      a user's iPhone and iPad might pass the iOS device names \"Bob's iPhone\" and\n      \"Bob's iPad\". The device description must be between 1 and\n      EDAM_DEVICE_DESCRIPTION_LEN_MAX characters long and must match the regular\n      expression EDAM_DEVICE_DESCRIPTION_REGEX.\n    \n    @param supportsTwoFactor\n      Whether the calling application supports two-factor authentication. If this\n      parameter is false, this method will fail with the error code INVALID_AUTH and the\n      parameter \"password\" when called for a user who has enabled two-factor\n      authentication.\n    \n    @return\n      <p>The result of the authentication. The level of detail provided in the returned\n      AuthenticationResult.User structure depends on the access level granted by\n      calling application's API key.</p>\n      <p>If the user has two-factor authentication enabled,\n      AuthenticationResult.secondFactorRequired will be set and\n      AuthenticationResult.authenticationToken will contain a short-lived token\n      that may only be used to complete the two-factor authentication process by calling\n      UserStore.completeTwoFactorAuthentication.</p>\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"username\" - username is empty\n      <li> DATA_REQUIRED \"password\" - password is empty\n      <li> DATA_REQUIRED \"consumerKey\" - consumerKey is empty\n      <li> DATA_REQUIRED \"consumerSecret\" - consumerSecret is empty\n      <li> DATA_REQUIRED \"deviceDescription\" - deviceDescription is empty\n      <li> BAD_DATA_FORMAT \"deviceDescription\" - deviceDescription is not valid.\n      <li> BAD_DATA_FORMAT \"deviceIdentifier\" - deviceIdentifier is not valid.\n      <li> INVALID_AUTH \"username\" - username not found\n      <li> INVALID_AUTH \"password\" - password did not match\n      <li> INVALID_AUTH \"consumerKey\" - consumerKey is not authorized\n      <li> INVALID_AUTH \"consumerSecret\" - consumerSecret is incorrect\n      <li> PERMISSION_DENIED \"User.active\" - user account is closed\n      <li> PERMISSION_DENIED \"User.tooManyFailuresTryAgainLater\" - user has\n        failed authentication too often\n    </ul>\n    \n    Parameters:\n     - username\n     - password\n     - consumerKey\n     - consumerSecret\n     - deviceIdentifier\n     - deviceDescription\n     - supportsTwoFactor\n    \"\"\"\n    self.send_authenticateLongSession(username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor)\n    return self.recv_authenticateLongSession()\n\n  def send_authenticateLongSession(self, username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor):\n    self._oprot.writeMessageBegin('authenticateLongSession', TMessageType.CALL, self._seqid)\n    args = authenticateLongSession_args()\n    args.username = username\n    args.password = password\n    args.consumerKey = consumerKey\n    args.consumerSecret = consumerSecret\n    args.deviceIdentifier = deviceIdentifier\n    args.deviceDescription = deviceDescription\n    args.supportsTwoFactor = supportsTwoFactor\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_authenticateLongSession(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = authenticateLongSession_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"authenticateLongSession failed: unknown result\");\n\n  def completeTwoFactorAuthentication(self, authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription):\n    \"\"\"\n    Complete the authentication process when a second factor is required. This\n    call is made after a successful call to authenticate or authenticateLongSession\n    when the authenticating user has enabled two-factor authentication.\n    \n    @param authenticationToken An authentication token returned by a previous\n      call to UserStore.authenticate or UserStore.authenticateLongSession that\n      could not be completed in a single call because a second factor was required.\n    \n    @param oneTimeCode The one time code entered by the user. This value is delivered\n      out-of-band, typically via SMS or an authenticator application.\n    \n    @param deviceIdentifier See the corresponding parameter in authenticateLongSession.\n    \n    @param deviceDescription See the corresponding parameter in authenticateLongSession.\n    \n    @return\n      The result of the authentication. The level of detail provided in the returned\n      AuthenticationResult.User structure depends on the access level granted by the\n      calling application's API key. If the initial authentication call was made to\n      authenticateLongSession, the AuthenticationResult will contain a long-lived\n      authentication token.\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"authenticationToken\" - authenticationToken is empty\n      <li> DATA_REQUIRED \"oneTimeCode\" - oneTimeCode is empty\n      <li> BAD_DATA_FORMAT \"authenticationToken\" - authenticationToken is not well formed\n      <li> INVALID_AUTH \"oneTimeCode\" - oneTimeCode did not match\n      <li> AUTH_EXPIRED \"authenticationToken\" - authenticationToken has expired\n      <li> PERMISSION_DENIED \"authenticationToken\" - authenticationToken is not valid\n      <li> PERMISSION_DENIED \"User.active\" - user account is closed\n      <li> PERMISSION_DENIED \"User.tooManyFailuresTryAgainLater\" - user has\n        failed authentication too often\n      <li> DATA_CONFLICT \"User.twoFactorAuthentication\" - The user has not enabled\n         two-factor authentication.</li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n     - oneTimeCode\n     - deviceIdentifier\n     - deviceDescription\n    \"\"\"\n    self.send_completeTwoFactorAuthentication(authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription)\n    return self.recv_completeTwoFactorAuthentication()\n\n  def send_completeTwoFactorAuthentication(self, authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription):\n    self._oprot.writeMessageBegin('completeTwoFactorAuthentication', TMessageType.CALL, self._seqid)\n    args = completeTwoFactorAuthentication_args()\n    args.authenticationToken = authenticationToken\n    args.oneTimeCode = oneTimeCode\n    args.deviceIdentifier = deviceIdentifier\n    args.deviceDescription = deviceDescription\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_completeTwoFactorAuthentication(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = completeTwoFactorAuthentication_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"completeTwoFactorAuthentication failed: unknown result\");\n\n  def revokeLongSession(self, authenticationToken):\n    \"\"\"\n    Revoke an existing long lived authentication token. This can be used to\n    revoke OAuth tokens or tokens created by calling authenticateLongSession,\n    and allows a user to effectively log out of Evernote from the perspective\n    of the application that holds the token. The authentication token that is\n    passed is immediately revoked and may not be used to call any authenticated\n    EDAM function.\n    \n    @param authenticationToken the authentication token to revoke.\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"authenticationToken\" - no authentication token provided\n      <li> BAD_DATA_FORMAT \"authenticationToken\" - the authentication token is not well formed\n      <li> INVALID_AUTH \"authenticationToken\" - the authentication token is invalid\n      <li> AUTH_EXPIRED \"authenticationToken\" - the authentication token is expired or\n        is already revoked.\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_revokeLongSession(authenticationToken)\n    self.recv_revokeLongSession()\n\n  def send_revokeLongSession(self, authenticationToken):\n    self._oprot.writeMessageBegin('revokeLongSession', TMessageType.CALL, self._seqid)\n    args = revokeLongSession_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_revokeLongSession(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = revokeLongSession_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    return\n\n  def authenticateToBusiness(self, authenticationToken):\n    \"\"\"\n    This is used to take an existing authentication token that grants access\n    to an individual user account (returned from 'authenticate',\n    'authenticateLongSession' or an OAuth authorization) and obtain an additional\n    authentication token that may be used to access business notebooks if the user\n    is a member of an Evernote Business account.\n    \n    The resulting authentication token may be used to make NoteStore API calls\n    against the business using the NoteStore URL returned in the result.\n    \n    @param authenticationToken\n      The authentication token for the user. This may not be a shared authentication\n      token (returned by NoteStore.authenticateToSharedNotebook or\n      NoteStore.authenticateToSharedNote) or a business authentication token.\n    \n    @return\n      The result of the authentication, with the token granting access to the\n      business in the result's 'authenticationToken' field. The URL that must\n      be used to access the business account NoteStore will be returned in the\n      result's 'noteStoreUrl' field.  The 'User' field will\n      not be set in the result.\n    \n    @throws EDAMUserException <ul>\n      <li> PERMISSION_DENIED \"authenticationToken\" - the provided authentication token\n           is a shared or business authentication token. </li>\n      <li> PERMISSION_DENIED \"Business\" - the user identified by the provided\n           authentication token is not currently a member of a business. </li>\n      <li> PERMISSION_DENIED \"Business.status\" - the business that the user is a\n           member of is not currently in an active status. </li>\n    </ul>\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_authenticateToBusiness(authenticationToken)\n    return self.recv_authenticateToBusiness()\n\n  def send_authenticateToBusiness(self, authenticationToken):\n    self._oprot.writeMessageBegin('authenticateToBusiness', TMessageType.CALL, self._seqid)\n    args = authenticateToBusiness_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_authenticateToBusiness(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = authenticateToBusiness_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"authenticateToBusiness failed: unknown result\");\n\n  def refreshAuthentication(self, authenticationToken):\n    \"\"\"\n    This is used to take an existing authentication token (returned from\n    'authenticate') and exchange it for a newer token which will not expire\n    as soon.  This must be invoked before the previous token expires.\n    \n    This function is only availabe to Evernote's internal applications.\n    \n    @param authenticationToken\n      The previous authentication token from the authenticate() result.\n    \n    @return\n      The result of the authentication, with the new token in\n      the result's 'authenticationToken' field.  The 'User' field will\n      not be set in the result.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_refreshAuthentication(authenticationToken)\n    return self.recv_refreshAuthentication()\n\n  def send_refreshAuthentication(self, authenticationToken):\n    self._oprot.writeMessageBegin('refreshAuthentication', TMessageType.CALL, self._seqid)\n    args = refreshAuthentication_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_refreshAuthentication(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = refreshAuthentication_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"refreshAuthentication failed: unknown result\");\n\n  def getUser(self, authenticationToken):\n    \"\"\"\n    Returns the User corresponding to the provided authentication token,\n    or throws an exception if this token is not valid.\n    The level of detail provided in the returned User structure depends on\n    the access level granted by the token, so a web service client may receive\n    fewer fields than an integrated desktop client.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_getUser(authenticationToken)\n    return self.recv_getUser()\n\n  def send_getUser(self, authenticationToken):\n    self._oprot.writeMessageBegin('getUser', TMessageType.CALL, self._seqid)\n    args = getUser_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getUser(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getUser_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getUser failed: unknown result\");\n\n  def getPublicUserInfo(self, username):\n    \"\"\"\n    Asks the UserStore about the publicly available location information for\n    a particular username.\n    \n    @throws EDAMUserException <ul>\n      <li> DATA_REQUIRED \"username\" - username is empty\n    </ul>\n    \n    Parameters:\n     - username\n    \"\"\"\n    self.send_getPublicUserInfo(username)\n    return self.recv_getPublicUserInfo()\n\n  def send_getPublicUserInfo(self, username):\n    self._oprot.writeMessageBegin('getPublicUserInfo', TMessageType.CALL, self._seqid)\n    args = getPublicUserInfo_args()\n    args.username = username\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getPublicUserInfo(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getPublicUserInfo_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.notFoundException is not None:\n      raise result.notFoundException\n    if result.systemException is not None:\n      raise result.systemException\n    if result.userException is not None:\n      raise result.userException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getPublicUserInfo failed: unknown result\");\n\n  def getPremiumInfo(self, authenticationToken):\n    \"\"\"\n    Returns information regarding a user's Premium account corresponding to the\n    provided authentication token, or throws an exception if this token is not\n    valid.\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_getPremiumInfo(authenticationToken)\n    return self.recv_getPremiumInfo()\n\n  def send_getPremiumInfo(self, authenticationToken):\n    self._oprot.writeMessageBegin('getPremiumInfo', TMessageType.CALL, self._seqid)\n    args = getPremiumInfo_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getPremiumInfo(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getPremiumInfo_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getPremiumInfo failed: unknown result\");\n\n  def getNoteStoreUrl(self, authenticationToken):\n    \"\"\"\n    Returns the URL that should be used to talk to the NoteStore for the\n    account represented by the provided authenticationToken.\n    This method isn't needed by most clients, who can retrieve the correct\n    NoteStore URL from the AuthenticationResult returned from the authenticate\n    or refreshAuthentication calls. This method is typically only needed\n    to look up the correct URL for a long-lived session token (e.g. for an\n    OAuth web service).\n    \n    Parameters:\n     - authenticationToken\n    \"\"\"\n    self.send_getNoteStoreUrl(authenticationToken)\n    return self.recv_getNoteStoreUrl()\n\n  def send_getNoteStoreUrl(self, authenticationToken):\n    self._oprot.writeMessageBegin('getNoteStoreUrl', TMessageType.CALL, self._seqid)\n    args = getNoteStoreUrl_args()\n    args.authenticationToken = authenticationToken\n    args.write(self._oprot)\n    self._oprot.writeMessageEnd()\n    self._oprot.trans.flush()\n\n  def recv_getNoteStoreUrl(self, ):\n    (fname, mtype, rseqid) = self._iprot.readMessageBegin()\n    if mtype == TMessageType.EXCEPTION:\n      x = TApplicationException()\n      x.read(self._iprot)\n      self._iprot.readMessageEnd()\n      raise x\n    result = getNoteStoreUrl_result()\n    result.read(self._iprot)\n    self._iprot.readMessageEnd()\n    if result.success is not None:\n      return result.success\n    if result.userException is not None:\n      raise result.userException\n    if result.systemException is not None:\n      raise result.systemException\n    raise TApplicationException(TApplicationException.MISSING_RESULT, \"getNoteStoreUrl failed: unknown result\");\n\n\nclass Processor(Iface, TProcessor):\n  def __init__(self, handler):\n    self._handler = handler\n    self._processMap = {}\n    self._processMap[\"checkVersion\"] = Processor.process_checkVersion\n    self._processMap[\"getBootstrapInfo\"] = Processor.process_getBootstrapInfo\n    self._processMap[\"authenticate\"] = Processor.process_authenticate\n    self._processMap[\"authenticateLongSession\"] = Processor.process_authenticateLongSession\n    self._processMap[\"completeTwoFactorAuthentication\"] = Processor.process_completeTwoFactorAuthentication\n    self._processMap[\"revokeLongSession\"] = Processor.process_revokeLongSession\n    self._processMap[\"authenticateToBusiness\"] = Processor.process_authenticateToBusiness\n    self._processMap[\"refreshAuthentication\"] = Processor.process_refreshAuthentication\n    self._processMap[\"getUser\"] = Processor.process_getUser\n    self._processMap[\"getPublicUserInfo\"] = Processor.process_getPublicUserInfo\n    self._processMap[\"getPremiumInfo\"] = Processor.process_getPremiumInfo\n    self._processMap[\"getNoteStoreUrl\"] = Processor.process_getNoteStoreUrl\n\n  def process(self, iprot, oprot):\n    (name, type, seqid) = iprot.readMessageBegin()\n    if name not in self._processMap:\n      iprot.skip(TType.STRUCT)\n      iprot.readMessageEnd()\n      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))\n      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)\n      x.write(oprot)\n      oprot.writeMessageEnd()\n      oprot.trans.flush()\n      return\n    else:\n      self._processMap[name](self, seqid, iprot, oprot)\n    return True\n\n  def process_checkVersion(self, seqid, iprot, oprot):\n    args = checkVersion_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = checkVersion_result()\n    result.success = self._handler.checkVersion(args.clientName, args.edamVersionMajor, args.edamVersionMinor)\n    oprot.writeMessageBegin(\"checkVersion\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getBootstrapInfo(self, seqid, iprot, oprot):\n    args = getBootstrapInfo_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getBootstrapInfo_result()\n    result.success = self._handler.getBootstrapInfo(args.locale)\n    oprot.writeMessageBegin(\"getBootstrapInfo\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_authenticate(self, seqid, iprot, oprot):\n    args = authenticate_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = authenticate_result()\n    try:\n      result.success = self._handler.authenticate(args.username, args.password, args.consumerKey, args.consumerSecret, args.supportsTwoFactor)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"authenticate\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_authenticateLongSession(self, seqid, iprot, oprot):\n    args = authenticateLongSession_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = authenticateLongSession_result()\n    try:\n      result.success = self._handler.authenticateLongSession(args.username, args.password, args.consumerKey, args.consumerSecret, args.deviceIdentifier, args.deviceDescription, args.supportsTwoFactor)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"authenticateLongSession\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_completeTwoFactorAuthentication(self, seqid, iprot, oprot):\n    args = completeTwoFactorAuthentication_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = completeTwoFactorAuthentication_result()\n    try:\n      result.success = self._handler.completeTwoFactorAuthentication(args.authenticationToken, args.oneTimeCode, args.deviceIdentifier, args.deviceDescription)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"completeTwoFactorAuthentication\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_revokeLongSession(self, seqid, iprot, oprot):\n    args = revokeLongSession_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = revokeLongSession_result()\n    try:\n      self._handler.revokeLongSession(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"revokeLongSession\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_authenticateToBusiness(self, seqid, iprot, oprot):\n    args = authenticateToBusiness_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = authenticateToBusiness_result()\n    try:\n      result.success = self._handler.authenticateToBusiness(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"authenticateToBusiness\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_refreshAuthentication(self, seqid, iprot, oprot):\n    args = refreshAuthentication_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = refreshAuthentication_result()\n    try:\n      result.success = self._handler.refreshAuthentication(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"refreshAuthentication\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getUser(self, seqid, iprot, oprot):\n    args = getUser_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getUser_result()\n    try:\n      result.success = self._handler.getUser(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"getUser\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getPublicUserInfo(self, seqid, iprot, oprot):\n    args = getPublicUserInfo_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getPublicUserInfo_result()\n    try:\n      result.success = self._handler.getPublicUserInfo(args.username)\n    except evernote.edam.error.ttypes.EDAMNotFoundException, notFoundException:\n      result.notFoundException = notFoundException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    oprot.writeMessageBegin(\"getPublicUserInfo\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getPremiumInfo(self, seqid, iprot, oprot):\n    args = getPremiumInfo_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getPremiumInfo_result()\n    try:\n      result.success = self._handler.getPremiumInfo(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"getPremiumInfo\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n  def process_getNoteStoreUrl(self, seqid, iprot, oprot):\n    args = getNoteStoreUrl_args()\n    args.read(iprot)\n    iprot.readMessageEnd()\n    result = getNoteStoreUrl_result()\n    try:\n      result.success = self._handler.getNoteStoreUrl(args.authenticationToken)\n    except evernote.edam.error.ttypes.EDAMUserException, userException:\n      result.userException = userException\n    except evernote.edam.error.ttypes.EDAMSystemException, systemException:\n      result.systemException = systemException\n    oprot.writeMessageBegin(\"getNoteStoreUrl\", TMessageType.REPLY, seqid)\n    result.write(oprot)\n    oprot.writeMessageEnd()\n    oprot.trans.flush()\n\n\n# HELPER FUNCTIONS AND STRUCTURES\n\nclass checkVersion_args(object):\n  \"\"\"\n  Attributes:\n   - clientName\n   - edamVersionMajor\n   - edamVersionMinor\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'clientName', None, None, ), # 1\n    (2, TType.I16, 'edamVersionMajor', None, 1, ), # 2\n    (3, TType.I16, 'edamVersionMinor', None, 25, ), # 3\n  )\n\n  def __init__(self, clientName=None, edamVersionMajor=thrift_spec[2][4], edamVersionMinor=thrift_spec[3][4],):\n    self.clientName = clientName\n    self.edamVersionMajor = edamVersionMajor\n    self.edamVersionMinor = edamVersionMinor\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.clientName = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I16:\n          self.edamVersionMajor = iprot.readI16();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I16:\n          self.edamVersionMinor = iprot.readI16();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('checkVersion_args')\n    if self.clientName is not None:\n      oprot.writeFieldBegin('clientName', TType.STRING, 1)\n      oprot.writeString(self.clientName)\n      oprot.writeFieldEnd()\n    if self.edamVersionMajor is not None:\n      oprot.writeFieldBegin('edamVersionMajor', TType.I16, 2)\n      oprot.writeI16(self.edamVersionMajor)\n      oprot.writeFieldEnd()\n    if self.edamVersionMinor is not None:\n      oprot.writeFieldBegin('edamVersionMinor', TType.I16, 3)\n      oprot.writeI16(self.edamVersionMinor)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass checkVersion_result(object):\n  \"\"\"\n  Attributes:\n   - success\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.BOOL, 'success', None, None, ), # 0\n  )\n\n  def __init__(self, success=None,):\n    self.success = success\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.BOOL:\n          self.success = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('checkVersion_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.BOOL, 0)\n      oprot.writeBool(self.success)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getBootstrapInfo_args(object):\n  \"\"\"\n  Attributes:\n   - locale\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'locale', None, None, ), # 1\n  )\n\n  def __init__(self, locale=None,):\n    self.locale = locale\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.locale = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getBootstrapInfo_args')\n    if self.locale is not None:\n      oprot.writeFieldBegin('locale', TType.STRING, 1)\n      oprot.writeString(self.locale)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getBootstrapInfo_result(object):\n  \"\"\"\n  Attributes:\n   - success\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (BootstrapInfo, BootstrapInfo.thrift_spec), None, ), # 0\n  )\n\n  def __init__(self, success=None,):\n    self.success = success\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = BootstrapInfo()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getBootstrapInfo_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass authenticate_args(object):\n  \"\"\"\n  Attributes:\n   - username\n   - password\n   - consumerKey\n   - consumerSecret\n   - supportsTwoFactor\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'username', None, None, ), # 1\n    (2, TType.STRING, 'password', None, None, ), # 2\n    (3, TType.STRING, 'consumerKey', None, None, ), # 3\n    (4, TType.STRING, 'consumerSecret', None, None, ), # 4\n    (5, TType.BOOL, 'supportsTwoFactor', None, None, ), # 5\n  )\n\n  def __init__(self, username=None, password=None, consumerKey=None, consumerSecret=None, supportsTwoFactor=None,):\n    self.username = username\n    self.password = password\n    self.consumerKey = consumerKey\n    self.consumerSecret = consumerSecret\n    self.supportsTwoFactor = supportsTwoFactor\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.username = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.password = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.consumerKey = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.consumerSecret = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.supportsTwoFactor = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('authenticate_args')\n    if self.username is not None:\n      oprot.writeFieldBegin('username', TType.STRING, 1)\n      oprot.writeString(self.username)\n      oprot.writeFieldEnd()\n    if self.password is not None:\n      oprot.writeFieldBegin('password', TType.STRING, 2)\n      oprot.writeString(self.password)\n      oprot.writeFieldEnd()\n    if self.consumerKey is not None:\n      oprot.writeFieldBegin('consumerKey', TType.STRING, 3)\n      oprot.writeString(self.consumerKey)\n      oprot.writeFieldEnd()\n    if self.consumerSecret is not None:\n      oprot.writeFieldBegin('consumerSecret', TType.STRING, 4)\n      oprot.writeString(self.consumerSecret)\n      oprot.writeFieldEnd()\n    if self.supportsTwoFactor is not None:\n      oprot.writeFieldBegin('supportsTwoFactor', TType.BOOL, 5)\n      oprot.writeBool(self.supportsTwoFactor)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass authenticate_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (AuthenticationResult, AuthenticationResult.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = AuthenticationResult()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('authenticate_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass authenticateLongSession_args(object):\n  \"\"\"\n  Attributes:\n   - username\n   - password\n   - consumerKey\n   - consumerSecret\n   - deviceIdentifier\n   - deviceDescription\n   - supportsTwoFactor\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'username', None, None, ), # 1\n    (2, TType.STRING, 'password', None, None, ), # 2\n    (3, TType.STRING, 'consumerKey', None, None, ), # 3\n    (4, TType.STRING, 'consumerSecret', None, None, ), # 4\n    (5, TType.STRING, 'deviceIdentifier', None, None, ), # 5\n    (6, TType.STRING, 'deviceDescription', None, None, ), # 6\n    (7, TType.BOOL, 'supportsTwoFactor', None, None, ), # 7\n  )\n\n  def __init__(self, username=None, password=None, consumerKey=None, consumerSecret=None, deviceIdentifier=None, deviceDescription=None, supportsTwoFactor=None,):\n    self.username = username\n    self.password = password\n    self.consumerKey = consumerKey\n    self.consumerSecret = consumerSecret\n    self.deviceIdentifier = deviceIdentifier\n    self.deviceDescription = deviceDescription\n    self.supportsTwoFactor = supportsTwoFactor\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.username = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.password = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.consumerKey = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.consumerSecret = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.STRING:\n          self.deviceIdentifier = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.STRING:\n          self.deviceDescription = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.BOOL:\n          self.supportsTwoFactor = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('authenticateLongSession_args')\n    if self.username is not None:\n      oprot.writeFieldBegin('username', TType.STRING, 1)\n      oprot.writeString(self.username)\n      oprot.writeFieldEnd()\n    if self.password is not None:\n      oprot.writeFieldBegin('password', TType.STRING, 2)\n      oprot.writeString(self.password)\n      oprot.writeFieldEnd()\n    if self.consumerKey is not None:\n      oprot.writeFieldBegin('consumerKey', TType.STRING, 3)\n      oprot.writeString(self.consumerKey)\n      oprot.writeFieldEnd()\n    if self.consumerSecret is not None:\n      oprot.writeFieldBegin('consumerSecret', TType.STRING, 4)\n      oprot.writeString(self.consumerSecret)\n      oprot.writeFieldEnd()\n    if self.deviceIdentifier is not None:\n      oprot.writeFieldBegin('deviceIdentifier', TType.STRING, 5)\n      oprot.writeString(self.deviceIdentifier)\n      oprot.writeFieldEnd()\n    if self.deviceDescription is not None:\n      oprot.writeFieldBegin('deviceDescription', TType.STRING, 6)\n      oprot.writeString(self.deviceDescription)\n      oprot.writeFieldEnd()\n    if self.supportsTwoFactor is not None:\n      oprot.writeFieldBegin('supportsTwoFactor', TType.BOOL, 7)\n      oprot.writeBool(self.supportsTwoFactor)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass authenticateLongSession_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (AuthenticationResult, AuthenticationResult.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = AuthenticationResult()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('authenticateLongSession_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass completeTwoFactorAuthentication_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n   - oneTimeCode\n   - deviceIdentifier\n   - deviceDescription\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n    (2, TType.STRING, 'oneTimeCode', None, None, ), # 2\n    (3, TType.STRING, 'deviceIdentifier', None, None, ), # 3\n    (4, TType.STRING, 'deviceDescription', None, None, ), # 4\n  )\n\n  def __init__(self, authenticationToken=None, oneTimeCode=None, deviceIdentifier=None, deviceDescription=None,):\n    self.authenticationToken = authenticationToken\n    self.oneTimeCode = oneTimeCode\n    self.deviceIdentifier = deviceIdentifier\n    self.deviceDescription = deviceDescription\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.oneTimeCode = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.deviceIdentifier = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.deviceDescription = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('completeTwoFactorAuthentication_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.oneTimeCode is not None:\n      oprot.writeFieldBegin('oneTimeCode', TType.STRING, 2)\n      oprot.writeString(self.oneTimeCode)\n      oprot.writeFieldEnd()\n    if self.deviceIdentifier is not None:\n      oprot.writeFieldBegin('deviceIdentifier', TType.STRING, 3)\n      oprot.writeString(self.deviceIdentifier)\n      oprot.writeFieldEnd()\n    if self.deviceDescription is not None:\n      oprot.writeFieldBegin('deviceDescription', TType.STRING, 4)\n      oprot.writeString(self.deviceDescription)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass completeTwoFactorAuthentication_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (AuthenticationResult, AuthenticationResult.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = AuthenticationResult()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('completeTwoFactorAuthentication_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass revokeLongSession_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('revokeLongSession_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass revokeLongSession_result(object):\n  \"\"\"\n  Attributes:\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, userException=None, systemException=None,):\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('revokeLongSession_result')\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass authenticateToBusiness_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('authenticateToBusiness_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass authenticateToBusiness_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (AuthenticationResult, AuthenticationResult.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = AuthenticationResult()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('authenticateToBusiness_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass refreshAuthentication_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('refreshAuthentication_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass refreshAuthentication_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (AuthenticationResult, AuthenticationResult.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = AuthenticationResult()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('refreshAuthentication_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getUser_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getUser_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getUser_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.User, evernote.edam.type.ttypes.User.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.User()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getUser_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getPublicUserInfo_args(object):\n  \"\"\"\n  Attributes:\n   - username\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'username', None, None, ), # 1\n  )\n\n  def __init__(self, username=None,):\n    self.username = username\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.username = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getPublicUserInfo_args')\n    if self.username is not None:\n      oprot.writeFieldBegin('username', TType.STRING, 1)\n      oprot.writeString(self.username)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getPublicUserInfo_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - notFoundException\n   - systemException\n   - userException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (PublicUserInfo, PublicUserInfo.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n    (3, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 3\n  )\n\n  def __init__(self, success=None, notFoundException=None, systemException=None, userException=None,):\n    self.success = success\n    self.notFoundException = notFoundException\n    self.systemException = systemException\n    self.userException = userException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = PublicUserInfo()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException()\n          self.notFoundException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getPublicUserInfo_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.notFoundException is not None:\n      oprot.writeFieldBegin('notFoundException', TType.STRUCT, 1)\n      self.notFoundException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 3)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getPremiumInfo_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getPremiumInfo_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getPremiumInfo_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.PremiumInfo, evernote.edam.type.ttypes.PremiumInfo.thrift_spec), None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRUCT:\n          self.success = evernote.edam.type.ttypes.PremiumInfo()\n          self.success.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getPremiumInfo_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRUCT, 0)\n      self.success.write(oprot)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteStoreUrl_args(object):\n  \"\"\"\n  Attributes:\n   - authenticationToken\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'authenticationToken', None, None, ), # 1\n  )\n\n  def __init__(self, authenticationToken=None,):\n    self.authenticationToken = authenticationToken\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteStoreUrl_args')\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 1)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass getNoteStoreUrl_result(object):\n  \"\"\"\n  Attributes:\n   - success\n   - userException\n   - systemException\n  \"\"\"\n\n  thrift_spec = (\n    (0, TType.STRING, 'success', None, None, ), # 0\n    (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1\n    (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, success=None, userException=None, systemException=None,):\n    self.success = success\n    self.userException = userException\n    self.systemException = systemException\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 0:\n        if ftype == TType.STRING:\n          self.success = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 1:\n        if ftype == TType.STRUCT:\n          self.userException = evernote.edam.error.ttypes.EDAMUserException()\n          self.userException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.systemException = evernote.edam.error.ttypes.EDAMSystemException()\n          self.systemException.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('getNoteStoreUrl_result')\n    if self.success is not None:\n      oprot.writeFieldBegin('success', TType.STRING, 0)\n      oprot.writeString(self.success)\n      oprot.writeFieldEnd()\n    if self.userException is not None:\n      oprot.writeFieldBegin('userException', TType.STRUCT, 1)\n      self.userException.write(oprot)\n      oprot.writeFieldEnd()\n    if self.systemException is not None:\n      oprot.writeFieldBegin('systemException', TType.STRUCT, 2)\n      self.systemException.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n"
  },
  {
    "path": "lib/evernote/edam/userstore/__init__.py",
    "content": "__all__ = ['ttypes', 'constants', 'UserStore']\n"
  },
  {
    "path": "lib/evernote/edam/userstore/constants.py",
    "content": "#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nfrom ttypes import *\n\nEDAM_VERSION_MAJOR = 1\nEDAM_VERSION_MINOR = 25\n"
  },
  {
    "path": "lib/evernote/edam/userstore/ttypes.py",
    "content": "#\n# Autogenerated by Thrift Compiler\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n#  options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nimport evernote.edam.type.ttypes\nimport evernote.edam.error.ttypes\n\n\nfrom thrift.transport import TTransport\nfrom thrift.protocol import TBinaryProtocol, TProtocol\ntry:\n  from thrift.protocol import fastbinary\nexcept:\n  fastbinary = None\n\n\n\nclass PublicUserInfo(object):\n  \"\"\"\n   This structure is used to provide publicly-available user information\n   about a particular account.\n  <dl>\n   <dt>userId:</dt>\n     <dd>\n     The unique numeric user identifier for the user account.\n     </dd>\n   <dt>shardId:</dt>\n     <dd>\n     DEPRECATED - Client applications should have no need to use this field.\n     </dd>\n   <dt>privilege:</dt>\n     <dd>\n     The privilege level of the account, to determine whether\n     this is a Premium or Free account.\n     </dd>\n   <dt>noteStoreUrl:</dt>\n     <dd>\n     This field will contain the full URL that clients should use to make\n     NoteStore requests to the server shard that contains that user's data.\n     I.e. this is the URL that should be used to create the Thrift HTTP client\n     transport to send messages to the NoteStore service for the account.\n     </dd>\n   <dt>webApiUrlPrefix:</dt>\n     <dd>\n     This field will contain the initial part of the URLs that should be used\n     to make requests to Evernote's thin client \"web API\", which provide\n     optimized operations for clients that aren't capable of manipulating\n     the full contents of accounts via the full Thrift data model. Clients\n     should concatenate the relative path for the various servlets onto the\n     end of this string to construct the full URL, as documented on our\n     developer web site.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - userId\n   - shardId\n   - privilege\n   - username\n   - noteStoreUrl\n   - webApiUrlPrefix\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I32, 'userId', None, None, ), # 1\n    (2, TType.STRING, 'shardId', None, None, ), # 2\n    (3, TType.I32, 'privilege', None, None, ), # 3\n    (4, TType.STRING, 'username', None, None, ), # 4\n    (5, TType.STRING, 'noteStoreUrl', None, None, ), # 5\n    (6, TType.STRING, 'webApiUrlPrefix', None, None, ), # 6\n  )\n\n  def __init__(self, userId=None, shardId=None, privilege=None, username=None, noteStoreUrl=None, webApiUrlPrefix=None,):\n    self.userId = userId\n    self.shardId = shardId\n    self.privilege = privilege\n    self.username = username\n    self.noteStoreUrl = noteStoreUrl\n    self.webApiUrlPrefix = webApiUrlPrefix\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I32:\n          self.userId = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.shardId = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I32:\n          self.privilege = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.username = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.STRING:\n          self.noteStoreUrl = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.STRING:\n          self.webApiUrlPrefix = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('PublicUserInfo')\n    if self.userId is not None:\n      oprot.writeFieldBegin('userId', TType.I32, 1)\n      oprot.writeI32(self.userId)\n      oprot.writeFieldEnd()\n    if self.shardId is not None:\n      oprot.writeFieldBegin('shardId', TType.STRING, 2)\n      oprot.writeString(self.shardId)\n      oprot.writeFieldEnd()\n    if self.privilege is not None:\n      oprot.writeFieldBegin('privilege', TType.I32, 3)\n      oprot.writeI32(self.privilege)\n      oprot.writeFieldEnd()\n    if self.username is not None:\n      oprot.writeFieldBegin('username', TType.STRING, 4)\n      oprot.writeString(self.username)\n      oprot.writeFieldEnd()\n    if self.noteStoreUrl is not None:\n      oprot.writeFieldBegin('noteStoreUrl', TType.STRING, 5)\n      oprot.writeString(self.noteStoreUrl)\n      oprot.writeFieldEnd()\n    if self.webApiUrlPrefix is not None:\n      oprot.writeFieldBegin('webApiUrlPrefix', TType.STRING, 6)\n      oprot.writeString(self.webApiUrlPrefix)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.userId is None:\n      raise TProtocol.TProtocolException(message='Required field userId is unset!')\n    if self.shardId is None:\n      raise TProtocol.TProtocolException(message='Required field shardId is unset!')\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass AuthenticationResult(object):\n  \"\"\"\n   When an authentication (or re-authentication) is performed, this structure\n   provides the result to the client.\n  <dl>\n   <dt>currentTime:</dt>\n     <dd>\n     The server-side date and time when this result was\n     generated.\n     </dd>\n   <dt>authenticationToken:</dt>\n     <dd>\n     Holds an opaque, ASCII-encoded token that can be\n     used by the client to perform actions on a NoteStore.\n     </dd>\n   <dt>expiration:</dt>\n     <dd>\n     Holds the server-side date and time when the\n     authentication token will expire.\n     This time can be compared to \"currentTime\" to produce an expiration\n     time that can be reconciled with the client's local clock.\n     </dd>\n   <dt>user:</dt>\n     <dd>\n     Holds the information about the account which was\n     authenticated if this was a full authentication.  May be absent if this\n     particular authentication did not require user information.\n     </dd>\n   <dt>publicUserInfo:</dt>\n     <dd>\n     If this authentication result was achieved without full permissions to\n     access the full User structure, this field may be set to give back\n     a more limited public set of data.\n     </dd>\n   <dt>noteStoreUrl:</dt>\n     <dd>\n     This field will contain the full URL that clients should use to make\n     NoteStore requests to the server shard that contains that user's data.\n     I.e. this is the URL that should be used to create the Thrift HTTP client\n     transport to send messages to the NoteStore service for the account.\n     </dd>\n   <dt>webApiUrlPrefix:</dt>\n     <dd>\n     This field will contain the initial part of the URLs that should be used\n     to make requests to Evernote's thin client \"web API\", which provide\n     optimized operations for clients that aren't capable of manipulating\n     the full contents of accounts via the full Thrift data model. Clients\n     should concatenate the relative path for the various servlets onto the\n     end of this string to construct the full URL, as documented on our\n     developer web site.\n     </dd>\n   <dt>secondFactorRequired:</dt>\n     <dd>\n     If set to true, this field indicates that the user has enabled two-factor\n     authentication and must enter their second factor in order to complete\n     authentication. In this case the value of authenticationResult will be\n     a short-lived authentication token that may only be used to make a\n     subsequent call to completeTwoFactorAuthentication.\n     </dd>\n   <dt>secondFactorDeliveryHint:</dt>\n     <dd>\n     When secondFactorRequired is set to true, this field may contain a string\n     describing the second factor delivery method that the user has configured.\n     This will typically be an obfuscated mobile device number, such as\n     \"(xxx) xxx-x095\". This string can be displayed to the user to remind them\n     how to obtain the required second factor.\n     TODO do we need to differentiate between SMS and voice delivery?\n     </dd>\n   </dl>\n  \n  Attributes:\n   - currentTime\n   - authenticationToken\n   - expiration\n   - user\n   - publicUserInfo\n   - noteStoreUrl\n   - webApiUrlPrefix\n   - secondFactorRequired\n   - secondFactorDeliveryHint\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.I64, 'currentTime', None, None, ), # 1\n    (2, TType.STRING, 'authenticationToken', None, None, ), # 2\n    (3, TType.I64, 'expiration', None, None, ), # 3\n    (4, TType.STRUCT, 'user', (evernote.edam.type.ttypes.User, evernote.edam.type.ttypes.User.thrift_spec), None, ), # 4\n    (5, TType.STRUCT, 'publicUserInfo', (PublicUserInfo, PublicUserInfo.thrift_spec), None, ), # 5\n    (6, TType.STRING, 'noteStoreUrl', None, None, ), # 6\n    (7, TType.STRING, 'webApiUrlPrefix', None, None, ), # 7\n    (8, TType.BOOL, 'secondFactorRequired', None, None, ), # 8\n    (9, TType.STRING, 'secondFactorDeliveryHint', None, None, ), # 9\n  )\n\n  def __init__(self, currentTime=None, authenticationToken=None, expiration=None, user=None, publicUserInfo=None, noteStoreUrl=None, webApiUrlPrefix=None, secondFactorRequired=None, secondFactorDeliveryHint=None,):\n    self.currentTime = currentTime\n    self.authenticationToken = authenticationToken\n    self.expiration = expiration\n    self.user = user\n    self.publicUserInfo = publicUserInfo\n    self.noteStoreUrl = noteStoreUrl\n    self.webApiUrlPrefix = webApiUrlPrefix\n    self.secondFactorRequired = secondFactorRequired\n    self.secondFactorDeliveryHint = secondFactorDeliveryHint\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.I64:\n          self.currentTime = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.authenticationToken = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.I64:\n          self.expiration = iprot.readI64();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRUCT:\n          self.user = evernote.edam.type.ttypes.User()\n          self.user.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.STRUCT:\n          self.publicUserInfo = PublicUserInfo()\n          self.publicUserInfo.read(iprot)\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.STRING:\n          self.noteStoreUrl = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.STRING:\n          self.webApiUrlPrefix = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.BOOL:\n          self.secondFactorRequired = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.STRING:\n          self.secondFactorDeliveryHint = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('AuthenticationResult')\n    if self.currentTime is not None:\n      oprot.writeFieldBegin('currentTime', TType.I64, 1)\n      oprot.writeI64(self.currentTime)\n      oprot.writeFieldEnd()\n    if self.authenticationToken is not None:\n      oprot.writeFieldBegin('authenticationToken', TType.STRING, 2)\n      oprot.writeString(self.authenticationToken)\n      oprot.writeFieldEnd()\n    if self.expiration is not None:\n      oprot.writeFieldBegin('expiration', TType.I64, 3)\n      oprot.writeI64(self.expiration)\n      oprot.writeFieldEnd()\n    if self.user is not None:\n      oprot.writeFieldBegin('user', TType.STRUCT, 4)\n      self.user.write(oprot)\n      oprot.writeFieldEnd()\n    if self.publicUserInfo is not None:\n      oprot.writeFieldBegin('publicUserInfo', TType.STRUCT, 5)\n      self.publicUserInfo.write(oprot)\n      oprot.writeFieldEnd()\n    if self.noteStoreUrl is not None:\n      oprot.writeFieldBegin('noteStoreUrl', TType.STRING, 6)\n      oprot.writeString(self.noteStoreUrl)\n      oprot.writeFieldEnd()\n    if self.webApiUrlPrefix is not None:\n      oprot.writeFieldBegin('webApiUrlPrefix', TType.STRING, 7)\n      oprot.writeString(self.webApiUrlPrefix)\n      oprot.writeFieldEnd()\n    if self.secondFactorRequired is not None:\n      oprot.writeFieldBegin('secondFactorRequired', TType.BOOL, 8)\n      oprot.writeBool(self.secondFactorRequired)\n      oprot.writeFieldEnd()\n    if self.secondFactorDeliveryHint is not None:\n      oprot.writeFieldBegin('secondFactorDeliveryHint', TType.STRING, 9)\n      oprot.writeString(self.secondFactorDeliveryHint)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.currentTime is None:\n      raise TProtocol.TProtocolException(message='Required field currentTime is unset!')\n    if self.authenticationToken is None:\n      raise TProtocol.TProtocolException(message='Required field authenticationToken is unset!')\n    if self.expiration is None:\n      raise TProtocol.TProtocolException(message='Required field expiration is unset!')\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass BootstrapSettings(object):\n  \"\"\"\n   This structure describes a collection of bootstrap settings.\n  <dl>\n   <dt>serviceHost:</dt>\n     <dd>\n     The hostname and optional port for composing Evernote web service URLs.\n     This URL can be used to access the UserStore and related services,\n     but must not be used to compose the NoteStore URL. Client applications\n     must handle serviceHost values that include only the hostname\n     (e.g. www.evernote.com) or both the hostname and port (e.g. www.evernote.com:8080).\n     If no port is specified, or if port 443 is specified, client applications must\n     use the scheme \"https\" when composing URLs. Otherwise, a client must use the\n     scheme \"http\".\n   </dd>\n   <dt>marketingUrl:</dt>\n     <dd>\n     The URL stem for the Evernote corporate marketing website, e.g. http://www.evernote.com.\n     This stem can be used to compose website URLs. For example, the URL of the Evernote\n     Trunk is composed by appending \"/about/trunk/\" to the value of marketingUrl.\n     </dd>\n   <dt>supportUrl:</dt>\n     <dd>\n     The full URL for the Evernote customer support website, e.g. https://support.evernote.com.\n     </dd>\n   <dt>accountEmailDomain:</dt>\n     <dd>\n     The domain used for an Evernote user's incoming email address, which allows notes to\n     be emailed into an account. E.g. m.evernote.com.\n     </dd>\n   <dt>enableFacebookSharing:</dt>\n     <dd>\n     Whether the client application should enable sharing of notes on Facebook.\n     </dd>\n   <dt>enableGiftSubscriptions:</dt>\n     <dd>\n     Whether the client application should enable gift subscriptions.\n     </dd>\n   <dt>enableSupportTickets:</dt>\n     <dd>\n     Whether the client application should enable in-client creation of support tickets.\n     </dd>\n   <dt>enableSharedNotebooks:</dt>\n     <dd>\n     Whether the client application should enable shared notebooks.\n     </dd>\n   <dt>enableSingleNoteSharing:</dt>\n     <dd>\n     Whether the client application should enable single note sharing.\n     </dd>\n   <dt>enableSponsoredAccounts:</dt>\n     <dd>\n     Whether the client application should enable sponsored accounts.\n     </dd>\n   <dt>enableTwitterSharing:</dt>\n     <dd>\n     Whether the client application should enable sharing of notes on Twitter.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - serviceHost\n   - marketingUrl\n   - supportUrl\n   - accountEmailDomain\n   - enableFacebookSharing\n   - enableGiftSubscriptions\n   - enableSupportTickets\n   - enableSharedNotebooks\n   - enableSingleNoteSharing\n   - enableSponsoredAccounts\n   - enableTwitterSharing\n   - enableLinkedInSharing\n   - enablePublicNotebooks\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'serviceHost', None, None, ), # 1\n    (2, TType.STRING, 'marketingUrl', None, None, ), # 2\n    (3, TType.STRING, 'supportUrl', None, None, ), # 3\n    (4, TType.STRING, 'accountEmailDomain', None, None, ), # 4\n    (5, TType.BOOL, 'enableFacebookSharing', None, None, ), # 5\n    (6, TType.BOOL, 'enableGiftSubscriptions', None, None, ), # 6\n    (7, TType.BOOL, 'enableSupportTickets', None, None, ), # 7\n    (8, TType.BOOL, 'enableSharedNotebooks', None, None, ), # 8\n    (9, TType.BOOL, 'enableSingleNoteSharing', None, None, ), # 9\n    (10, TType.BOOL, 'enableSponsoredAccounts', None, None, ), # 10\n    (11, TType.BOOL, 'enableTwitterSharing', None, None, ), # 11\n    (12, TType.BOOL, 'enableLinkedInSharing', None, None, ), # 12\n    (13, TType.BOOL, 'enablePublicNotebooks', None, None, ), # 13\n  )\n\n  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,):\n    self.serviceHost = serviceHost\n    self.marketingUrl = marketingUrl\n    self.supportUrl = supportUrl\n    self.accountEmailDomain = accountEmailDomain\n    self.enableFacebookSharing = enableFacebookSharing\n    self.enableGiftSubscriptions = enableGiftSubscriptions\n    self.enableSupportTickets = enableSupportTickets\n    self.enableSharedNotebooks = enableSharedNotebooks\n    self.enableSingleNoteSharing = enableSingleNoteSharing\n    self.enableSponsoredAccounts = enableSponsoredAccounts\n    self.enableTwitterSharing = enableTwitterSharing\n    self.enableLinkedInSharing = enableLinkedInSharing\n    self.enablePublicNotebooks = enablePublicNotebooks\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.serviceHost = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRING:\n          self.marketingUrl = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 3:\n        if ftype == TType.STRING:\n          self.supportUrl = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 4:\n        if ftype == TType.STRING:\n          self.accountEmailDomain = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 5:\n        if ftype == TType.BOOL:\n          self.enableFacebookSharing = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 6:\n        if ftype == TType.BOOL:\n          self.enableGiftSubscriptions = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 7:\n        if ftype == TType.BOOL:\n          self.enableSupportTickets = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 8:\n        if ftype == TType.BOOL:\n          self.enableSharedNotebooks = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 9:\n        if ftype == TType.BOOL:\n          self.enableSingleNoteSharing = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 10:\n        if ftype == TType.BOOL:\n          self.enableSponsoredAccounts = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 11:\n        if ftype == TType.BOOL:\n          self.enableTwitterSharing = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 12:\n        if ftype == TType.BOOL:\n          self.enableLinkedInSharing = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      elif fid == 13:\n        if ftype == TType.BOOL:\n          self.enablePublicNotebooks = iprot.readBool();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('BootstrapSettings')\n    if self.serviceHost is not None:\n      oprot.writeFieldBegin('serviceHost', TType.STRING, 1)\n      oprot.writeString(self.serviceHost)\n      oprot.writeFieldEnd()\n    if self.marketingUrl is not None:\n      oprot.writeFieldBegin('marketingUrl', TType.STRING, 2)\n      oprot.writeString(self.marketingUrl)\n      oprot.writeFieldEnd()\n    if self.supportUrl is not None:\n      oprot.writeFieldBegin('supportUrl', TType.STRING, 3)\n      oprot.writeString(self.supportUrl)\n      oprot.writeFieldEnd()\n    if self.accountEmailDomain is not None:\n      oprot.writeFieldBegin('accountEmailDomain', TType.STRING, 4)\n      oprot.writeString(self.accountEmailDomain)\n      oprot.writeFieldEnd()\n    if self.enableFacebookSharing is not None:\n      oprot.writeFieldBegin('enableFacebookSharing', TType.BOOL, 5)\n      oprot.writeBool(self.enableFacebookSharing)\n      oprot.writeFieldEnd()\n    if self.enableGiftSubscriptions is not None:\n      oprot.writeFieldBegin('enableGiftSubscriptions', TType.BOOL, 6)\n      oprot.writeBool(self.enableGiftSubscriptions)\n      oprot.writeFieldEnd()\n    if self.enableSupportTickets is not None:\n      oprot.writeFieldBegin('enableSupportTickets', TType.BOOL, 7)\n      oprot.writeBool(self.enableSupportTickets)\n      oprot.writeFieldEnd()\n    if self.enableSharedNotebooks is not None:\n      oprot.writeFieldBegin('enableSharedNotebooks', TType.BOOL, 8)\n      oprot.writeBool(self.enableSharedNotebooks)\n      oprot.writeFieldEnd()\n    if self.enableSingleNoteSharing is not None:\n      oprot.writeFieldBegin('enableSingleNoteSharing', TType.BOOL, 9)\n      oprot.writeBool(self.enableSingleNoteSharing)\n      oprot.writeFieldEnd()\n    if self.enableSponsoredAccounts is not None:\n      oprot.writeFieldBegin('enableSponsoredAccounts', TType.BOOL, 10)\n      oprot.writeBool(self.enableSponsoredAccounts)\n      oprot.writeFieldEnd()\n    if self.enableTwitterSharing is not None:\n      oprot.writeFieldBegin('enableTwitterSharing', TType.BOOL, 11)\n      oprot.writeBool(self.enableTwitterSharing)\n      oprot.writeFieldEnd()\n    if self.enableLinkedInSharing is not None:\n      oprot.writeFieldBegin('enableLinkedInSharing', TType.BOOL, 12)\n      oprot.writeBool(self.enableLinkedInSharing)\n      oprot.writeFieldEnd()\n    if self.enablePublicNotebooks is not None:\n      oprot.writeFieldBegin('enablePublicNotebooks', TType.BOOL, 13)\n      oprot.writeBool(self.enablePublicNotebooks)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.serviceHost is None:\n      raise TProtocol.TProtocolException(message='Required field serviceHost is unset!')\n    if self.marketingUrl is None:\n      raise TProtocol.TProtocolException(message='Required field marketingUrl is unset!')\n    if self.supportUrl is None:\n      raise TProtocol.TProtocolException(message='Required field supportUrl is unset!')\n    if self.accountEmailDomain is None:\n      raise TProtocol.TProtocolException(message='Required field accountEmailDomain is unset!')\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass BootstrapProfile(object):\n  \"\"\"\n   This structure describes a collection of bootstrap settings.\n  <dl>\n   <dt>name:</dt>\n     <dd>\n     The unique name of the profile, which is guaranteed to remain consistent across\n     calls to getBootstrapInfo.\n     </dd>\n   <dt>settings:</dt>\n     <dd>\n     The settings for this profile.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - name\n   - settings\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.STRING, 'name', None, None, ), # 1\n    (2, TType.STRUCT, 'settings', (BootstrapSettings, BootstrapSettings.thrift_spec), None, ), # 2\n  )\n\n  def __init__(self, name=None, settings=None,):\n    self.name = name\n    self.settings = settings\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.name = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.STRUCT:\n          self.settings = BootstrapSettings()\n          self.settings.read(iprot)\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('BootstrapProfile')\n    if self.name is not None:\n      oprot.writeFieldBegin('name', TType.STRING, 1)\n      oprot.writeString(self.name)\n      oprot.writeFieldEnd()\n    if self.settings is not None:\n      oprot.writeFieldBegin('settings', TType.STRUCT, 2)\n      self.settings.write(oprot)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.name is None:\n      raise TProtocol.TProtocolException(message='Required field name is unset!')\n    if self.settings is None:\n      raise TProtocol.TProtocolException(message='Required field settings is unset!')\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n\nclass BootstrapInfo(object):\n  \"\"\"\n   This structure describes a collection of bootstrap profiles.\n  <dl>\n   <dt>profiles:</dt>\n     <dd>\n     List of one or more bootstrap profiles, in descending\n     preference order.\n     </dd>\n   </dl>\n  \n  Attributes:\n   - profiles\n  \"\"\"\n\n  thrift_spec = (\n    None, # 0\n    (1, TType.LIST, 'profiles', (TType.STRUCT,(BootstrapProfile, BootstrapProfile.thrift_spec)), None, ), # 1\n  )\n\n  def __init__(self, profiles=None,):\n    self.profiles = profiles\n\n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.LIST:\n          self.profiles = []\n          (_etype3, _size0) = iprot.readListBegin()\n          for _i4 in xrange(_size0):\n            _elem5 = BootstrapProfile()\n            _elem5.read(iprot)\n            self.profiles.append(_elem5)\n          iprot.readListEnd()\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStructBegin('BootstrapInfo')\n    if self.profiles is not None:\n      oprot.writeFieldBegin('profiles', TType.LIST, 1)\n      oprot.writeListBegin(TType.STRUCT, len(self.profiles))\n      for iter6 in self.profiles:\n        iter6.write(oprot)\n      oprot.writeListEnd()\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n\n  def validate(self):\n    if self.profiles is None:\n      raise TProtocol.TProtocolException(message='Required field profiles is unset!')\n    return\n\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, value)\n      for key, value in self.__dict__.iteritems()]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n  def __ne__(self, other):\n    return not (self == other)\n"
  },
  {
    "path": "lib/httplib.py",
    "content": "\"\"\"HTTP/1.1 client library\n\n<intro stuff goes here>\n<other stuff, too>\n\nHTTPConnection goes through a number of \"states\", which define when a client\nmay legally make another request or fetch the response for a particular\nrequest. This diagram details these state transitions:\n\n    (null)\n      |\n      | HTTPConnection()\n      v\n    Idle\n      |\n      | putrequest()\n      v\n    Request-started\n      |\n      | ( putheader() )*  endheaders()\n      v\n    Request-sent\n      |\n      | response = getresponse()\n      v\n    Unread-response   [Response-headers-read]\n      |\\____________________\n      |                     |\n      | response.read()     | putrequest()\n      v                     v\n    Idle                  Req-started-unread-response\n                     ______/|\n                   /        |\n   response.read() |        | ( putheader() )*  endheaders()\n                   v        v\n       Request-started    Req-sent-unread-response\n                            |\n                            | response.read()\n                            v\n                          Request-sent\n\nThis diagram presents the following rules:\n  -- a second request may not be started until {response-headers-read}\n  -- a response [object] cannot be retrieved until {request-sent}\n  -- there is no differentiation between an unread response body and a\n     partially read response body\n\nNote: this enforcement is applied by the HTTPConnection class. The\n      HTTPResponse class does not enforce this state machine, which\n      implies sophisticated clients may accelerate the request/response\n      pipeline. Caution should be taken, though: accelerating the states\n      beyond the above pattern may imply knowledge of the server's\n      connection-close behavior for certain requests. For example, it\n      is impossible to tell whether the server will close the connection\n      UNTIL the response headers have been read; this means that further\n      requests cannot be placed into the pipeline until it is known that\n      the server will NOT be closing the connection.\n\nLogical State                  __state            __response\n-------------                  -------            ----------\nIdle                           _CS_IDLE           None\nRequest-started                _CS_REQ_STARTED    None\nRequest-sent                   _CS_REQ_SENT       None\nUnread-response                _CS_IDLE           <response_class>\nReq-started-unread-response    _CS_REQ_STARTED    <response_class>\nReq-sent-unread-response       _CS_REQ_SENT       <response_class>\n\"\"\"\n\nimport socket\nfrom sys import py3kwarning\nfrom urlparse import urlsplit\nimport warnings\nwith warnings.catch_warnings():\n    if py3kwarning:\n        warnings.filterwarnings(\"ignore\", \".*mimetools has been removed\",\n                                DeprecationWarning)\n    import mimetools\n\ntry:\n    from cStringIO import StringIO\nexcept ImportError:\n    from StringIO import StringIO\n\n__all__ = [\"HTTP\", \"HTTPResponse\", \"HTTPConnection\",\n           \"HTTPException\", \"NotConnected\", \"UnknownProtocol\",\n           \"UnknownTransferEncoding\", \"UnimplementedFileMode\",\n           \"IncompleteRead\", \"InvalidURL\", \"ImproperConnectionState\",\n           \"CannotSendRequest\", \"CannotSendHeader\", \"ResponseNotReady\",\n           \"BadStatusLine\", \"error\", \"responses\"]\n\nHTTP_PORT = 80\nHTTPS_PORT = 443\n\n_UNKNOWN = 'UNKNOWN'\n\n# connection states\n_CS_IDLE = 'Idle'\n_CS_REQ_STARTED = 'Request-started'\n_CS_REQ_SENT = 'Request-sent'\n\n# status codes\n# informational\nCONTINUE = 100\nSWITCHING_PROTOCOLS = 101\nPROCESSING = 102\n\n# successful\nOK = 200\nCREATED = 201\nACCEPTED = 202\nNON_AUTHORITATIVE_INFORMATION = 203\nNO_CONTENT = 204\nRESET_CONTENT = 205\nPARTIAL_CONTENT = 206\nMULTI_STATUS = 207\nIM_USED = 226\n\n# redirection\nMULTIPLE_CHOICES = 300\nMOVED_PERMANENTLY = 301\nFOUND = 302\nSEE_OTHER = 303\nNOT_MODIFIED = 304\nUSE_PROXY = 305\nTEMPORARY_REDIRECT = 307\n\n# client error\nBAD_REQUEST = 400\nUNAUTHORIZED = 401\nPAYMENT_REQUIRED = 402\nFORBIDDEN = 403\nNOT_FOUND = 404\nMETHOD_NOT_ALLOWED = 405\nNOT_ACCEPTABLE = 406\nPROXY_AUTHENTICATION_REQUIRED = 407\nREQUEST_TIMEOUT = 408\nCONFLICT = 409\nGONE = 410\nLENGTH_REQUIRED = 411\nPRECONDITION_FAILED = 412\nREQUEST_ENTITY_TOO_LARGE = 413\nREQUEST_URI_TOO_LONG = 414\nUNSUPPORTED_MEDIA_TYPE = 415\nREQUESTED_RANGE_NOT_SATISFIABLE = 416\nEXPECTATION_FAILED = 417\nUNPROCESSABLE_ENTITY = 422\nLOCKED = 423\nFAILED_DEPENDENCY = 424\nUPGRADE_REQUIRED = 426\n\n# server error\nINTERNAL_SERVER_ERROR = 500\nNOT_IMPLEMENTED = 501\nBAD_GATEWAY = 502\nSERVICE_UNAVAILABLE = 503\nGATEWAY_TIMEOUT = 504\nHTTP_VERSION_NOT_SUPPORTED = 505\nINSUFFICIENT_STORAGE = 507\nNOT_EXTENDED = 510\n\n# Mapping status codes to official W3C names\nresponses = {\n    100: 'Continue',\n    101: 'Switching Protocols',\n\n    200: 'OK',\n    201: 'Created',\n    202: 'Accepted',\n    203: 'Non-Authoritative Information',\n    204: 'No Content',\n    205: 'Reset Content',\n    206: 'Partial Content',\n\n    300: 'Multiple Choices',\n    301: 'Moved Permanently',\n    302: 'Found',\n    303: 'See Other',\n    304: 'Not Modified',\n    305: 'Use Proxy',\n    306: '(Unused)',\n    307: 'Temporary Redirect',\n\n    400: 'Bad Request',\n    401: 'Unauthorized',\n    402: 'Payment Required',\n    403: 'Forbidden',\n    404: 'Not Found',\n    405: 'Method Not Allowed',\n    406: 'Not Acceptable',\n    407: 'Proxy Authentication Required',\n    408: 'Request Timeout',\n    409: 'Conflict',\n    410: 'Gone',\n    411: 'Length Required',\n    412: 'Precondition Failed',\n    413: 'Request Entity Too Large',\n    414: 'Request-URI Too Long',\n    415: 'Unsupported Media Type',\n    416: 'Requested Range Not Satisfiable',\n    417: 'Expectation Failed',\n\n    500: 'Internal Server Error',\n    501: 'Not Implemented',\n    502: 'Bad Gateway',\n    503: 'Service Unavailable',\n    504: 'Gateway Timeout',\n    505: 'HTTP Version Not Supported',\n}\n\n# maximal amount of data to read at one time in _safe_read\nMAXAMOUNT = 1048576\n\nclass HTTPMessage(mimetools.Message):\n\n    def addheader(self, key, value):\n        \"\"\"Add header for field key handling repeats.\"\"\"\n        prev = self.dict.get(key)\n        if prev is None:\n            self.dict[key] = value\n        else:\n            combined = \", \".join((prev, value))\n            self.dict[key] = combined\n\n    def addcontinue(self, key, more):\n        \"\"\"Add more field data from a continuation line.\"\"\"\n        prev = self.dict[key]\n        self.dict[key] = prev + \"\\n \" + more\n\n    def readheaders(self):\n        \"\"\"Read header lines.\n\n        Read header lines up to the entirely blank line that terminates them.\n        The (normally blank) line that ends the headers is skipped, but not\n        included in the returned list.  If a non-header line ends the headers,\n        (which is an error), an attempt is made to backspace over it; it is\n        never included in the returned list.\n\n        The variable self.status is set to the empty string if all went well,\n        otherwise it is an error message.  The variable self.headers is a\n        completely uninterpreted list of lines contained in the header (so\n        printing them will reproduce the header exactly as it appears in the\n        file).\n\n        If multiple header fields with the same name occur, they are combined\n        according to the rules in RFC 2616 sec 4.2:\n\n        Appending each subsequent field-value to the first, each separated\n        by a comma. The order in which header fields with the same field-name\n        are received is significant to the interpretation of the combined\n        field value.\n        \"\"\"\n        # XXX The implementation overrides the readheaders() method of\n        # rfc822.Message.  The base class design isn't amenable to\n        # customized behavior here so the method here is a copy of the\n        # base class code with a few small changes.\n\n        self.dict = {}\n        self.unixfrom = ''\n        self.headers = hlist = []\n        self.status = ''\n        headerseen = \"\"\n        firstline = 1\n        startofline = unread = tell = None\n        if hasattr(self.fp, 'unread'):\n            unread = self.fp.unread\n        elif self.seekable:\n            tell = self.fp.tell\n        while True:\n            if tell:\n                try:\n                    startofline = tell()\n                except IOError:\n                    startofline = tell = None\n                    self.seekable = 0\n            line = self.fp.readline()\n            if not line:\n                self.status = 'EOF in headers'\n                break\n            # Skip unix From name time lines\n            if firstline and line.startswith('From '):\n                self.unixfrom = self.unixfrom + line\n                continue\n            firstline = 0\n            if headerseen and line[0] in ' \\t':\n                # XXX Not sure if continuation lines are handled properly\n                # for http and/or for repeating headers\n                # It's a continuation line.\n                hlist.append(line)\n                self.addcontinue(headerseen, line.strip())\n                continue\n            elif self.iscomment(line):\n                # It's a comment.  Ignore it.\n                continue\n            elif self.islast(line):\n                # Note! No pushback here!  The delimiter line gets eaten.\n                break\n            headerseen = self.isheader(line)\n            if headerseen:\n                # It's a legal header line, save it.\n                hlist.append(line)\n                self.addheader(headerseen, line[len(headerseen)+1:].strip())\n                continue\n            else:\n                # It's not a header line; throw it back and stop here.\n                if not self.dict:\n                    self.status = 'No headers'\n                else:\n                    self.status = 'Non-header line where header expected'\n                # Try to undo the read.\n                if unread:\n                    unread(line)\n                elif tell:\n                    self.fp.seek(startofline)\n                else:\n                    self.status = self.status + '; bad seek'\n                break\n\nclass HTTPResponse:\n\n    # strict: If true, raise BadStatusLine if the status line can't be\n    # parsed as a valid HTTP/1.0 or 1.1 status line.  By default it is\n    # false because it prevents clients from talking to HTTP/0.9\n    # servers.  Note that a response with a sufficiently corrupted\n    # status line will look like an HTTP/0.9 response.\n\n    # See RFC 2616 sec 19.6 and RFC 1945 sec 6 for details.\n\n    def __init__(self, sock, debuglevel=0, strict=0, method=None):\n        self.fp = sock.makefile('rb', 0)\n        self.debuglevel = debuglevel\n        self.strict = strict\n        self._method = method\n\n        self.msg = None\n\n        # from the Status-Line of the response\n        self.version = _UNKNOWN # HTTP-Version\n        self.status = _UNKNOWN  # Status-Code\n        self.reason = _UNKNOWN  # Reason-Phrase\n\n        self.chunked = _UNKNOWN         # is \"chunked\" being used?\n        self.chunk_left = _UNKNOWN      # bytes left to read in current chunk\n        self.length = _UNKNOWN          # number of bytes left in response\n        self.will_close = _UNKNOWN      # conn will close at end of response\n\n    def _read_status(self):\n        # Initialize with Simple-Response defaults\n        line = self.fp.readline()\n        if self.debuglevel > 0:\n            print \"reply:\", repr(line)\n        if not line:\n            # Presumably, the server closed the connection before\n            # sending a valid response.\n            raise BadStatusLine(line)\n        try:\n            [version, status, reason] = line.split(None, 2)\n        except ValueError:\n            try:\n                [version, status] = line.split(None, 1)\n                reason = \"\"\n            except ValueError:\n                # empty version will cause next test to fail and status\n                # will be treated as 0.9 response.\n                version = \"\"\n        if not version.startswith('HTTP/'):\n            if self.strict:\n                self.close()\n                raise BadStatusLine(line)\n            else:\n                # assume it's a Simple-Response from an 0.9 server\n                self.fp = LineAndFileWrapper(line, self.fp)\n                return \"HTTP/0.9\", 200, \"\"\n\n        # The status code is a three-digit number\n        try:\n            status = int(status)\n            if status < 100 or status > 999:\n                raise BadStatusLine(line)\n        except ValueError:\n            raise BadStatusLine(line)\n        return version, status, reason\n\n    def begin(self):\n        if self.msg is not None:\n            # we've already started reading the response\n            return\n\n        # read until we get a non-100 response\n        while True:\n            version, status, reason = self._read_status()\n            if status != CONTINUE:\n                break\n            # skip the header from the 100 response\n            while True:\n                skip = self.fp.readline().strip()\n                if not skip:\n                    break\n                if self.debuglevel > 0:\n                    print \"header:\", skip\n\n        self.status = status\n        self.reason = reason.strip()\n        if version == 'HTTP/1.0':\n            self.version = 10\n        elif version.startswith('HTTP/1.'):\n            self.version = 11   # use HTTP/1.1 code for HTTP/1.x where x>=1\n        elif version == 'HTTP/0.9':\n            self.version = 9\n        else:\n            raise UnknownProtocol(version)\n\n        if self.version == 9:\n            self.length = None\n            self.chunked = 0\n            self.will_close = 1\n            self.msg = HTTPMessage(StringIO())\n            return\n\n        self.msg = HTTPMessage(self.fp, 0)\n        if self.debuglevel > 0:\n            for hdr in self.msg.headers:\n                print \"header:\", hdr,\n\n        # don't let the msg keep an fp\n        self.msg.fp = None\n\n        # are we using the chunked-style of transfer encoding?\n        tr_enc = self.msg.getheader('transfer-encoding')\n        if tr_enc and tr_enc.lower() == \"chunked\":\n            self.chunked = 1\n            self.chunk_left = None\n        else:\n            self.chunked = 0\n\n        # will the connection close at the end of the response?\n        self.will_close = self._check_close()\n\n        # do we have a Content-Length?\n        # NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is \"chunked\"\n        length = self.msg.getheader('content-length')\n        if length and not self.chunked:\n            try:\n                self.length = int(length)\n            except ValueError:\n                self.length = None\n            else:\n                if self.length < 0:  # ignore nonsensical negative lengths\n                    self.length = None\n        else:\n            self.length = None\n\n        # does the body have a fixed length? (of zero)\n        if (status == NO_CONTENT or status == NOT_MODIFIED or\n            100 <= status < 200 or      # 1xx codes\n            self._method == 'HEAD'):\n            self.length = 0\n\n        # if the connection remains open, and we aren't using chunked, and\n        # a content-length was not provided, then assume that the connection\n        # WILL close.\n        if not self.will_close and \\\n           not self.chunked and \\\n           self.length is None:\n            self.will_close = 1\n\n    def _check_close(self):\n        conn = self.msg.getheader('connection')\n        if self.version == 11:\n            # An HTTP/1.1 proxy is assumed to stay open unless\n            # explicitly closed.\n            conn = self.msg.getheader('connection')\n            if conn and \"close\" in conn.lower():\n                return True\n            return False\n\n        # Some HTTP/1.0 implementations have support for persistent\n        # connections, using rules different than HTTP/1.1.\n\n        # For older HTTP, Keep-Alive indicates persistent connection.\n        if self.msg.getheader('keep-alive'):\n            return False\n\n        # At least Akamai returns a \"Connection: Keep-Alive\" header,\n        # which was supposed to be sent by the client.\n        if conn and \"keep-alive\" in conn.lower():\n            return False\n\n        # Proxy-Connection is a netscape hack.\n        pconn = self.msg.getheader('proxy-connection')\n        if pconn and \"keep-alive\" in pconn.lower():\n            return False\n\n        # otherwise, assume it will close\n        return True\n\n    def close(self):\n        if self.fp:\n            self.fp.close()\n            self.fp = None\n\n    def isclosed(self):\n        # NOTE: it is possible that we will not ever call self.close(). This\n        #       case occurs when will_close is TRUE, length is None, and we\n        #       read up to the last byte, but NOT past it.\n        #\n        # IMPLIES: if will_close is FALSE, then self.close() will ALWAYS be\n        #          called, meaning self.isclosed() is meaningful.\n        return self.fp is None\n\n    # XXX It would be nice to have readline and __iter__ for this, too.\n\n    def read(self, amt=None):\n        if self.fp is None:\n            return ''\n\n        if self.chunked:\n            return self._read_chunked(amt)\n\n        if amt is None:\n            # unbounded read\n            if self.length is None:\n                s = self.fp.read()\n            else:\n                s = self._safe_read(self.length)\n                self.length = 0\n            self.close()        # we read everything\n            return s\n\n        if self.length is not None:\n            if amt > self.length:\n                # clip the read to the \"end of response\"\n                amt = self.length\n\n        # we do not use _safe_read() here because this may be a .will_close\n        # connection, and the user is reading more bytes than will be provided\n        # (for example, reading in 1k chunks)\n        s = self.fp.read(amt)\n        if self.length is not None:\n            self.length -= len(s)\n            if not self.length:\n                self.close()\n        return s\n\n    def _read_chunked(self, amt):\n        assert self.chunked != _UNKNOWN\n        chunk_left = self.chunk_left\n        value = ''\n\n        # XXX This accumulates chunks by repeated string concatenation,\n        # which is not efficient as the number or size of chunks gets big.\n        while True:\n            if chunk_left is None:\n                line = self.fp.readline()\n                i = line.find(';')\n                if i >= 0:\n                    line = line[:i] # strip chunk-extensions\n                try:\n                    chunk_left = int(line, 16)\n                except ValueError:\n                    # close the connection as protocol synchronisation is\n                    # probably lost\n                    self.close()\n                    raise IncompleteRead(value)\n                if chunk_left == 0:\n                    break\n            if amt is None:\n                value += self._safe_read(chunk_left)\n            elif amt < chunk_left:\n                value += self._safe_read(amt)\n                self.chunk_left = chunk_left - amt\n                return value\n            elif amt == chunk_left:\n                value += self._safe_read(amt)\n                self._safe_read(2)  # toss the CRLF at the end of the chunk\n                self.chunk_left = None\n                return value\n            else:\n                value += self._safe_read(chunk_left)\n                amt -= chunk_left\n\n            # we read the whole chunk, get another\n            self._safe_read(2)      # toss the CRLF at the end of the chunk\n            chunk_left = None\n\n        # read and discard trailer up to the CRLF terminator\n        ### note: we shouldn't have any trailers!\n        while True:\n            line = self.fp.readline()\n            if not line:\n                # a vanishingly small number of sites EOF without\n                # sending the trailer\n                break\n            if line == '\\r\\n':\n                break\n\n        # we read everything; close the \"file\"\n        self.close()\n\n        return value\n\n    def _safe_read(self, amt):\n        \"\"\"Read the number of bytes requested, compensating for partial reads.\n\n        Normally, we have a blocking socket, but a read() can be interrupted\n        by a signal (resulting in a partial read).\n\n        Note that we cannot distinguish between EOF and an interrupt when zero\n        bytes have been read. IncompleteRead() will be raised in this\n        situation.\n\n        This function should be used when <amt> bytes \"should\" be present for\n        reading. If the bytes are truly not available (due to EOF), then the\n        IncompleteRead exception can be used to detect the problem.\n        \"\"\"\n        s = []\n        while amt > 0:\n            chunk = self.fp.read(min(amt, MAXAMOUNT))\n            if not chunk:\n                raise IncompleteRead(s)\n            s.append(chunk)\n            amt -= len(chunk)\n        return ''.join(s)\n\n    def getheader(self, name, default=None):\n        if self.msg is None:\n            raise ResponseNotReady()\n        return self.msg.getheader(name, default)\n\n    def getheaders(self):\n        \"\"\"Return list of (header, value) tuples.\"\"\"\n        if self.msg is None:\n            raise ResponseNotReady()\n        return self.msg.items()\n\n\nclass HTTPConnection:\n\n    _http_vsn = 11\n    _http_vsn_str = 'HTTP/1.1'\n\n    response_class = HTTPResponse\n    default_port = HTTP_PORT\n    auto_open = 1\n    debuglevel = 0\n    strict = 0\n\n    def __init__(self, host, port=None, strict=None,\n                 timeout=socket._GLOBAL_DEFAULT_TIMEOUT):\n        self.timeout = timeout\n        self.sock = None\n        self._buffer = []\n        self.__response = None\n        self.__state = _CS_IDLE\n        self._method = None\n\n        self._set_hostport(host, port)\n        if strict is not None:\n            self.strict = strict\n\n    def _set_hostport(self, host, port):\n        if port is None:\n            i = host.rfind(':')\n            j = host.rfind(']')         # ipv6 addresses have [...]\n            if i > j:\n                try:\n                    port = int(host[i+1:])\n                except ValueError:\n                    raise InvalidURL(\"nonnumeric port: '%s'\" % host[i+1:])\n                host = host[:i]\n            else:\n                port = self.default_port\n            if host and host[0] == '[' and host[-1] == ']':\n                host = host[1:-1]\n        self.host = host\n        self.port = port\n\n    def set_debuglevel(self, level):\n        self.debuglevel = level\n\n    def connect(self):\n        \"\"\"Connect to the host and port specified in __init__.\"\"\"\n        self.sock = socket.create_connection((self.host,self.port),\n                                             self.timeout)\n\n    def close(self):\n        \"\"\"Close the connection to the HTTP server.\"\"\"\n        if self.sock:\n            self.sock.close()   # close it manually... there may be other refs\n            self.sock = None\n        if self.__response:\n            self.__response.close()\n            self.__response = None\n        self.__state = _CS_IDLE\n\n    def send(self, str):\n        \"\"\"Send `str' to the server.\"\"\"\n        if self.sock is None:\n            if self.auto_open:\n                self.connect()\n            else:\n                raise NotConnected()\n\n        # send the data to the server. if we get a broken pipe, then close\n        # the socket. we want to reconnect when somebody tries to send again.\n        #\n        # NOTE: we DO propagate the error, though, because we cannot simply\n        #       ignore the error... the caller will know if they can retry.\n        if self.debuglevel > 0:\n            print \"send:\", repr(str)\n        try:\n            blocksize=8192\n            if hasattr(str,'read') :\n                if self.debuglevel > 0: print \"sendIng a read()able\"\n                data=str.read(blocksize)\n                while data:\n                    self.sock.sendall(data)\n                    data=str.read(blocksize)\n            else:\n                self.sock.sendall(str)\n        except socket.error, v:\n            if v[0] == 32:      # Broken pipe\n                self.close()\n            raise\n\n    def _output(self, s):\n        \"\"\"Add a line of output to the current request buffer.\n\n        Assumes that the line does *not* end with \\\\r\\\\n.\n        \"\"\"\n        self._buffer.append(s)\n\n    def _send_output(self):\n        \"\"\"Send the currently buffered request and clear the buffer.\n\n        Appends an extra \\\\r\\\\n to the buffer.\n        \"\"\"\n        self._buffer.extend((\"\", \"\"))\n        msg = \"\\r\\n\".join(self._buffer)\n        del self._buffer[:]\n        self.send(msg)\n\n    def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0):\n        \"\"\"Send a request to the server.\n\n        `method' specifies an HTTP request method, e.g. 'GET'.\n        `url' specifies the object being requested, e.g. '/index.html'.\n        `skip_host' if True does not add automatically a 'Host:' header\n        `skip_accept_encoding' if True does not add automatically an\n           'Accept-Encoding:' header\n        \"\"\"\n\n        # if a prior response has been completed, then forget about it.\n        if self.__response and self.__response.isclosed():\n            self.__response = None\n\n\n        # in certain cases, we cannot issue another request on this connection.\n        # this occurs when:\n        #   1) we are in the process of sending a request.   (_CS_REQ_STARTED)\n        #   2) a response to a previous request has signalled that it is going\n        #      to close the connection upon completion.\n        #   3) the headers for the previous response have not been read, thus\n        #      we cannot determine whether point (2) is true.   (_CS_REQ_SENT)\n        #\n        # if there is no prior response, then we can request at will.\n        #\n        # if point (2) is true, then we will have passed the socket to the\n        # response (effectively meaning, \"there is no prior response\"), and\n        # will open a new one when a new request is made.\n        #\n        # Note: if a prior response exists, then we *can* start a new request.\n        #       We are not allowed to begin fetching the response to this new\n        #       request, however, until that prior response is complete.\n        #\n        if self.__state == _CS_IDLE:\n            self.__state = _CS_REQ_STARTED\n        else:\n            raise CannotSendRequest()\n\n        # Save the method we use, we need it later in the response phase\n        self._method = method\n        if not url:\n            url = '/'\n        str = '%s %s %s' % (method, url, self._http_vsn_str)\n\n        self._output(str)\n\n        if self._http_vsn == 11:\n            # Issue some standard headers for better HTTP/1.1 compliance\n\n            if not skip_host:\n                # this header is issued *only* for HTTP/1.1\n                # connections. more specifically, this means it is\n                # only issued when the client uses the new\n                # HTTPConnection() class. backwards-compat clients\n                # will be using HTTP/1.0 and those clients may be\n                # issuing this header themselves. we should NOT issue\n                # it twice; some web servers (such as Apache) barf\n                # when they see two Host: headers\n\n                # If we need a non-standard port,include it in the\n                # header.  If the request is going through a proxy,\n                # but the host of the actual URL, not the host of the\n                # proxy.\n\n                netloc = ''\n                if url.startswith('http'):\n                    nil, netloc, nil, nil, nil = urlsplit(url)\n\n                if netloc:\n                    try:\n                        netloc_enc = netloc.encode(\"ascii\")\n                    except UnicodeEncodeError:\n                        netloc_enc = netloc.encode(\"idna\")\n                    self.putheader('Host', netloc_enc)\n                else:\n                    try:\n                        host_enc = self.host.encode(\"ascii\")\n                    except UnicodeEncodeError:\n                        host_enc = self.host.encode(\"idna\")\n                    if self.port == self.default_port:\n                        self.putheader('Host', host_enc)\n                    else:\n                        self.putheader('Host', \"%s:%s\" % (host_enc, self.port))\n\n            # note: we are assuming that clients will not attempt to set these\n            #       headers since *this* library must deal with the\n            #       consequences. this also means that when the supporting\n            #       libraries are updated to recognize other forms, then this\n            #       code should be changed (removed or updated).\n\n            # we only want a Content-Encoding of \"identity\" since we don't\n            # support encodings such as x-gzip or x-deflate.\n            if not skip_accept_encoding:\n                self.putheader('Accept-Encoding', 'identity')\n\n            # we can accept \"chunked\" Transfer-Encodings, but no others\n            # NOTE: no TE header implies *only* \"chunked\"\n            #self.putheader('TE', 'chunked')\n\n            # if TE is supplied in the header, then it must appear in a\n            # Connection header.\n            #self.putheader('Connection', 'TE')\n\n        else:\n            # For HTTP/1.0, the server will assume \"not chunked\"\n            pass\n\n    def putheader(self, header, value):\n        \"\"\"Send a request header line to the server.\n\n        For example: h.putheader('Accept', 'text/html')\n        \"\"\"\n        if self.__state != _CS_REQ_STARTED:\n            raise CannotSendHeader()\n\n        str = '%s: %s' % (header, value)\n        self._output(str)\n\n    def endheaders(self):\n        \"\"\"Indicate that the last header line has been sent to the server.\"\"\"\n\n        if self.__state == _CS_REQ_STARTED:\n            self.__state = _CS_REQ_SENT\n        else:\n            raise CannotSendHeader()\n\n        self._send_output()\n\n    def request(self, method, url, body=None, headers={}):\n        \"\"\"Send a complete request to the server.\"\"\"\n\n        try:\n            self._send_request(method, url, body, headers)\n        except socket.error, v:\n            # trap 'Broken pipe' if we're allowed to automatically reconnect\n            if v[0] != 32 or not self.auto_open:\n                raise\n            # try one more time\n            self._send_request(method, url, body, headers)\n\n    def _send_request(self, method, url, body, headers):\n        # honour explicitly requested Host: and Accept-Encoding headers\n        header_names = dict.fromkeys([k.lower() for k in headers])\n        skips = {}\n        if 'host' in header_names:\n            skips['skip_host'] = 1\n        if 'accept-encoding' in header_names:\n            skips['skip_accept_encoding'] = 1\n\n        self.putrequest(method, url, **skips)\n\n        if body and ('content-length' not in header_names):\n            thelen=None\n            try:\n                thelen=str(len(body))\n            except TypeError, te:\n                # If this is a file-like object, try to\n                # fstat its file descriptor\n                import os\n                try:\n                    thelen = str(os.fstat(body.fileno()).st_size)\n                except (AttributeError, OSError):\n                    # Don't send a length if this failed\n                    if self.debuglevel > 0: print \"Cannot stat!!\"\n\n            if thelen is not None:\n                self.putheader('Content-Length',thelen)\n        for hdr, value in headers.iteritems():\n            self.putheader(hdr, value)\n        self.endheaders()\n\n        if body:\n            self.send(body)\n\n    def getresponse(self):\n        \"Get the response from the server.\"\n\n        # if a prior response has been completed, then forget about it.\n        if self.__response and self.__response.isclosed():\n            self.__response = None\n\n        #\n        # if a prior response exists, then it must be completed (otherwise, we\n        # cannot read this response's header to determine the connection-close\n        # behavior)\n        #\n        # note: if a prior response existed, but was connection-close, then the\n        # socket and response were made independent of this HTTPConnection\n        # object since a new request requires that we open a whole new\n        # connection\n        #\n        # this means the prior response had one of two states:\n        #   1) will_close: this connection was reset and the prior socket and\n        #                  response operate independently\n        #   2) persistent: the response was retained and we await its\n        #                  isclosed() status to become true.\n        #\n        if self.__state != _CS_REQ_SENT or self.__response:\n            raise ResponseNotReady()\n\n        if self.debuglevel > 0:\n            response = self.response_class(self.sock, self.debuglevel,\n                                           strict=self.strict,\n                                           method=self._method)\n        else:\n            response = self.response_class(self.sock, strict=self.strict,\n                                           method=self._method)\n\n        response.begin()\n        assert response.will_close != _UNKNOWN\n        self.__state = _CS_IDLE\n\n        if response.will_close:\n            # this effectively passes the connection to the response\n            self.close()\n        else:\n            # remember this, so we can tell when it is complete\n            self.__response = response\n\n        return response\n\n\nclass HTTP:\n    \"Compatibility class with httplib.py from 1.5.\"\n\n    _http_vsn = 10\n    _http_vsn_str = 'HTTP/1.0'\n\n    debuglevel = 0\n\n    _connection_class = HTTPConnection\n\n    def __init__(self, host='', port=None, strict=None):\n        \"Provide a default host, since the superclass requires one.\"\n\n        # some joker passed 0 explicitly, meaning default port\n        if port == 0:\n            port = None\n\n        # Note that we may pass an empty string as the host; this will throw\n        # an error when we attempt to connect. Presumably, the client code\n        # will call connect before then, with a proper host.\n        self._setup(self._connection_class(host, port, strict))\n\n    def _setup(self, conn):\n        self._conn = conn\n\n        # set up delegation to flesh out interface\n        self.send = conn.send\n        self.putrequest = conn.putrequest\n        self.endheaders = conn.endheaders\n        self.set_debuglevel = conn.set_debuglevel\n\n        conn._http_vsn = self._http_vsn\n        conn._http_vsn_str = self._http_vsn_str\n\n        self.file = None\n\n    def connect(self, host=None, port=None):\n        \"Accept arguments to set the host/port, since the superclass doesn't.\"\n\n        if host is not None:\n            self._conn._set_hostport(host, port)\n        self._conn.connect()\n\n    def getfile(self):\n        \"Provide a getfile, since the superclass' does not use this concept.\"\n        return self.file\n\n    def putheader(self, header, *values):\n        \"The superclass allows only one value argument.\"\n        self._conn.putheader(header, '\\r\\n\\t'.join(values))\n\n    def getreply(self):\n        \"\"\"Compat definition since superclass does not define it.\n\n        Returns a tuple consisting of:\n        - server status code (e.g. '200' if all goes well)\n        - server \"reason\" corresponding to status code\n        - any RFC822 headers in the response from the server\n        \"\"\"\n        try:\n            response = self._conn.getresponse()\n        except BadStatusLine, e:\n            ### hmm. if getresponse() ever closes the socket on a bad request,\n            ### then we are going to have problems with self.sock\n\n            ### should we keep this behavior? do people use it?\n            # keep the socket open (as a file), and return it\n            self.file = self._conn.sock.makefile('rb', 0)\n\n            # close our socket -- we want to restart after any protocol error\n            self.close()\n\n            self.headers = None\n            return -1, e.line, None\n\n        self.headers = response.msg\n        self.file = response.fp\n        return response.status, response.reason, response.msg\n\n    def close(self):\n        self._conn.close()\n\n        # note that self.file == response.fp, which gets closed by the\n        # superclass. just clear the object ref here.\n        ### hmm. messy. if status==-1, then self.file is owned by us.\n        ### well... we aren't explicitly closing, but losing this ref will\n        ### do it\n        self.file = None\n\ntry:\n    import ssl\nexcept ImportError:\n    pass\nelse:\n    class HTTPSConnection(HTTPConnection):\n        \"This class allows communication via SSL.\"\n\n        default_port = HTTPS_PORT\n\n        def __init__(self, host, port=None, key_file=None, cert_file=None,\n                     strict=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):\n            HTTPConnection.__init__(self, host, port, strict, timeout)\n            self.key_file = key_file\n            self.cert_file = cert_file\n\n        def connect(self):\n            \"Connect to a host on a given (SSL) port.\"\n\n            sock = socket.create_connection((self.host, self.port), self.timeout)\n            self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)\n\n    __all__.append(\"HTTPSConnection\")\n\n    class HTTPS(HTTP):\n        \"\"\"Compatibility with 1.5 httplib interface\n\n        Python 1.5.2 did not have an HTTPS class, but it defined an\n        interface for sending http requests that is also useful for\n        https.\n        \"\"\"\n\n        _connection_class = HTTPSConnection\n\n        def __init__(self, host='', port=None, key_file=None, cert_file=None,\n                     strict=None):\n            # provide a default host, pass the X509 cert info\n\n            # urf. compensate for bad input.\n            if port == 0:\n                port = None\n            self._setup(self._connection_class(host, port, key_file,\n                                               cert_file, strict))\n\n            # we never actually use these for anything, but we keep them\n            # here for compatibility with post-1.5.2 CVS.\n            self.key_file = key_file\n            self.cert_file = cert_file\n\n\n    def FakeSocket (sock, sslobj):\n        warnings.warn(\"FakeSocket is deprecated, and won't be in 3.x.  \" +\n                      \"Use the result of ssl.wrap_socket() directly instead.\",\n                      DeprecationWarning, stacklevel=2)\n        return sslobj\n\n\nclass HTTPException(Exception):\n    # Subclasses that define an __init__ must call Exception.__init__\n    # or define self.args.  Otherwise, str() will fail.\n    pass\n\nclass NotConnected(HTTPException):\n    pass\n\nclass InvalidURL(HTTPException):\n    pass\n\nclass UnknownProtocol(HTTPException):\n    def __init__(self, version):\n        self.args = version,\n        self.version = version\n\nclass UnknownTransferEncoding(HTTPException):\n    pass\n\nclass UnimplementedFileMode(HTTPException):\n    pass\n\nclass IncompleteRead(HTTPException):\n    def __init__(self, partial):\n        self.args = partial,\n        self.partial = partial\n\nclass ImproperConnectionState(HTTPException):\n    pass\n\nclass CannotSendRequest(ImproperConnectionState):\n    pass\n\nclass CannotSendHeader(ImproperConnectionState):\n    pass\n\nclass ResponseNotReady(ImproperConnectionState):\n    pass\n\nclass BadStatusLine(HTTPException):\n    def __init__(self, line):\n        self.args = line,\n        self.line = line\n\n# for backwards compatibility\nerror = HTTPException\n\nclass LineAndFileWrapper:\n    \"\"\"A limited file-like object for HTTP/0.9 responses.\"\"\"\n\n    # The status-line parsing code calls readline(), which normally\n    # get the HTTP status line.  For a 0.9 response, however, this is\n    # actually the first line of the body!  Clients need to get a\n    # readable file object that contains that line.\n\n    def __init__(self, line, file):\n        self._line = line\n        self._file = file\n        self._line_consumed = 0\n        self._line_offset = 0\n        self._line_left = len(line)\n\n    def __getattr__(self, attr):\n        return getattr(self._file, attr)\n\n    def _done(self):\n        # called when the last byte is read from the line.  After the\n        # call, all read methods are delegated to the underlying file\n        # object.\n        self._line_consumed = 1\n        self.read = self._file.read\n        self.readline = self._file.readline\n        self.readlines = self._file.readlines\n\n    def read(self, amt=None):\n        if self._line_consumed:\n            return self._file.read(amt)\n        assert self._line_left\n        if amt is None or amt > self._line_left:\n            s = self._line[self._line_offset:]\n            self._done()\n            if amt is None:\n                return s + self._file.read()\n            else:\n                return s + self._file.read(amt - len(s))\n        else:\n            assert amt <= self._line_left\n            i = self._line_offset\n            j = i + amt\n            s = self._line[i:j]\n            self._line_offset = j\n            self._line_left -= amt\n            if self._line_left == 0:\n                self._done()\n            return s\n\n    def readline(self):\n        if self._line_consumed:\n            return self._file.readline()\n        assert self._line_left\n        s = self._line[self._line_offset:]\n        self._done()\n        return s\n\n    def readlines(self, size=None):\n        if self._line_consumed:\n            return self._file.readlines(size)\n        assert self._line_left\n        L = [self._line[self._line_offset:]]\n        self._done()\n        if size is None:\n            return L + self._file.readlines()\n        else:\n            return L + self._file.readlines(size)\n\ndef test():\n    \"\"\"Test this module.\n\n    A hodge podge of tests collected here, because they have too many\n    external dependencies for the regular test suite.\n    \"\"\"\n\n    import sys\n    import getopt\n    opts, args = getopt.getopt(sys.argv[1:], 'd')\n    dl = 0\n    for o, a in opts:\n        if o == '-d': dl = dl + 1\n    host = 'www.python.org'\n    selector = '/'\n    if args[0:]: host = args[0]\n    if args[1:]: selector = args[1]\n    h = HTTP()\n    h.set_debuglevel(dl)\n    h.connect(host)\n    h.putrequest('GET', selector)\n    h.endheaders()\n    status, reason, headers = h.getreply()\n    print 'status =', status\n    print 'reason =', reason\n    print \"read\", len(h.getfile().read())\n    print\n    if headers:\n        for header in headers.headers: print header.strip()\n    print\n\n    # minimal test that code to extract host from url works\n    class HTTP11(HTTP):\n        _http_vsn = 11\n        _http_vsn_str = 'HTTP/1.1'\n\n    h = HTTP11('www.python.org')\n    h.putrequest('GET', 'http://www.python.org/~jeremy/')\n    h.endheaders()\n    h.getreply()\n    h.close()\n\n    try:\n        import ssl\n    except ImportError:\n        pass\n    else:\n\n        for host, selector in (('sourceforge.net', '/projects/python'),\n                               ):\n            print \"https://%s%s\" % (host, selector)\n            hs = HTTPS()\n            hs.set_debuglevel(dl)\n            hs.connect(host)\n            hs.putrequest('GET', selector)\n            hs.endheaders()\n            status, reason, headers = hs.getreply()\n            print 'status =', status\n            print 'reason =', reason\n            print \"read\", len(hs.getfile().read())\n            print\n            if headers:\n                for header in headers.headers: print header.strip()\n            print\n\nif __name__ == '__main__':\n    test()\n"
  },
  {
    "path": "lib/httplib2/__init__.py",
    "content": "from __future__ import generators\n\"\"\"\nhttplib2\n\nA caching http interface that supports ETags and gzip\nto conserve bandwidth.\n\nRequires Python 2.3 or later\n\nChangelog:\n2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.\n\n\"\"\"\n\n__author__ = \"Joe Gregorio (joe@bitworking.org)\"\n__copyright__ = \"Copyright 2006, Joe Gregorio\"\n__contributors__ = [\"Thomas Broyer (t.broyer@ltgt.net)\",\n    \"James Antill\",\n    \"Xavier Verges Farrero\",\n    \"Jonathan Feinberg\",\n    \"Blair Zajac\",\n    \"Sam Ruby\",\n    \"Louis Nyffenegger\"]\n__license__ = \"MIT\"\n__version__ = \"0.7.6\"\n\nimport re\nimport sys\nimport email\nimport email.Utils\nimport email.Message\nimport email.FeedParser\nimport StringIO\nimport gzip\nimport zlib\n\n# Force loading of SSL-enabled httplib for Linux users\nimport sublime\nif sublime.platform() == 'linux':\n  import imp\n  import os\n  lib_folder = os.path.join(sublime.packages_path(), 'SublimeEvernote', 'lib')\n  m_info = imp.find_module('httplib', [lib_folder])\n  m = imp.load_module('httplib', *m_info)\nimport httplib\n\nimport urlparse\nimport urllib\nimport base64\nimport os\nimport copy\nimport calendar\nimport time\nimport random\nimport errno\ntry:\n    from hashlib import sha1 as _sha, md5 as _md5\nexcept ImportError:\n    # prior to Python 2.5, these were separate modules\n    import sha\n    import md5\n    _sha = sha.new\n    _md5 = md5.new\nimport hmac\nfrom gettext import gettext as _\nimport socket\n\ntry:\n    from httplib2 import socks\nexcept ImportError:\n    try:\n        import socks\n    except ImportError:\n        socks = None\n\n# Build the appropriate socket wrapper for ssl\ntry:\n    import ssl # python 2.6\n    ssl_SSLError = ssl.SSLError\n    def _ssl_wrap_socket(sock, key_file, cert_file,\n                         disable_validation, ca_certs):\n        if disable_validation:\n            cert_reqs = ssl.CERT_NONE\n        else:\n            cert_reqs = ssl.CERT_REQUIRED\n        # We should be specifying SSL version 3 or TLS v1, but the ssl module\n        # doesn't expose the necessary knobs. So we need to go with the default\n        # of SSLv23.\n        return ssl.wrap_socket(sock, keyfile=key_file, certfile=cert_file,\n                               cert_reqs=cert_reqs, ca_certs=ca_certs)\nexcept (AttributeError, ImportError):\n    ssl_SSLError = None\n    def _ssl_wrap_socket(sock, key_file, cert_file,\n                         disable_validation, ca_certs):\n        if not disable_validation:\n            raise CertificateValidationUnsupported(\n                    \"SSL certificate validation is not supported without \"\n                    \"the ssl module installed. To avoid this error, install \"\n                    \"the ssl module, or explicity disable validation.\")\n        ssl_sock = socket.ssl(sock, key_file, cert_file)\n        return httplib.FakeSocket(sock, ssl_sock)\n\n\nif sys.version_info >= (2,3):\n    from iri2uri import iri2uri\nelse:\n    def iri2uri(uri):\n        return uri\n\ndef has_timeout(timeout): # python 2.6\n    if hasattr(socket, '_GLOBAL_DEFAULT_TIMEOUT'):\n        return (timeout is not None and timeout is not socket._GLOBAL_DEFAULT_TIMEOUT)\n    return (timeout is not None)\n\n__all__ = ['Http', 'Response', 'ProxyInfo', 'HttpLib2Error',\n  'RedirectMissingLocation', 'RedirectLimit', 'FailedToDecompressContent',\n  'UnimplementedDigestAuthOptionError', 'UnimplementedHmacDigestAuthOptionError',\n  'debuglevel', 'ProxiesUnavailableError']\n\n\n# The httplib debug level, set to a non-zero value to get debug output\ndebuglevel = 0\n\n# A request will be tried 'RETRIES' times if it fails at the socket/connection level.\nRETRIES = 2\n\n# Python 2.3 support\nif sys.version_info < (2,4):\n    def sorted(seq):\n        seq.sort()\n        return seq\n\n# Python 2.3 support\ndef HTTPResponse__getheaders(self):\n    \"\"\"Return list of (header, value) tuples.\"\"\"\n    if self.msg is None:\n        raise httplib.ResponseNotReady()\n    return self.msg.items()\n\nif not hasattr(httplib.HTTPResponse, 'getheaders'):\n    httplib.HTTPResponse.getheaders = HTTPResponse__getheaders\n\n# All exceptions raised here derive from HttpLib2Error\nclass HttpLib2Error(Exception): pass\n\n# Some exceptions can be caught and optionally\n# be turned back into responses.\nclass HttpLib2ErrorWithResponse(HttpLib2Error):\n    def __init__(self, desc, response, content):\n        self.response = response\n        self.content = content\n        HttpLib2Error.__init__(self, desc)\n\nclass RedirectMissingLocation(HttpLib2ErrorWithResponse): pass\nclass RedirectLimit(HttpLib2ErrorWithResponse): pass\nclass FailedToDecompressContent(HttpLib2ErrorWithResponse): pass\nclass UnimplementedDigestAuthOptionError(HttpLib2ErrorWithResponse): pass\nclass UnimplementedHmacDigestAuthOptionError(HttpLib2ErrorWithResponse): pass\n\nclass MalformedHeader(HttpLib2Error): pass\nclass RelativeURIError(HttpLib2Error): pass\nclass ServerNotFoundError(HttpLib2Error): pass\nclass ProxiesUnavailableError(HttpLib2Error): pass\nclass CertificateValidationUnsupported(HttpLib2Error): pass\nclass SSLHandshakeError(HttpLib2Error): pass\nclass NotSupportedOnThisPlatform(HttpLib2Error): pass\nclass CertificateHostnameMismatch(SSLHandshakeError):\n  def __init__(self, desc, host, cert):\n    HttpLib2Error.__init__(self, desc)\n    self.host = host\n    self.cert = cert\n\n# Open Items:\n# -----------\n# Proxy support\n\n# Are we removing the cached content too soon on PUT (only delete on 200 Maybe?)\n\n# Pluggable cache storage (supports storing the cache in\n#   flat files by default. We need a plug-in architecture\n#   that can support Berkeley DB and Squid)\n\n# == Known Issues ==\n# Does not handle a resource that uses conneg and Last-Modified but no ETag as a cache validator.\n# Does not handle Cache-Control: max-stale\n# Does not use Age: headers when calculating cache freshness.\n\n\n# The number of redirections to follow before giving up.\n# Note that only GET redirects are automatically followed.\n# Will also honor 301 requests by saving that info and never\n# requesting that URI again.\nDEFAULT_MAX_REDIRECTS = 5\n\n# Default CA certificates file bundled with httplib2.\nCA_CERTS = os.path.join(\n        os.path.dirname(os.path.abspath(__file__ )), \"cacerts.txt\")\n\n# Which headers are hop-by-hop headers by default\nHOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade']\n\ndef _get_end2end_headers(response):\n    hopbyhop = list(HOP_BY_HOP)\n    hopbyhop.extend([x.strip() for x in response.get('connection', '').split(',')])\n    return [header for header in response.keys() if header not in hopbyhop]\n\nURI = re.compile(r\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\")\n\ndef parse_uri(uri):\n    \"\"\"Parses a URI using the regex given in Appendix B of RFC 3986.\n\n        (scheme, authority, path, query, fragment) = parse_uri(uri)\n    \"\"\"\n    groups = URI.match(uri).groups()\n    return (groups[1], groups[3], groups[4], groups[6], groups[8])\n\ndef urlnorm(uri):\n    (scheme, authority, path, query, fragment) = parse_uri(uri)\n    if not scheme or not authority:\n        raise RelativeURIError(\"Only absolute URIs are allowed. uri = %s\" % uri)\n    authority = authority.lower()\n    scheme = scheme.lower()\n    if not path:\n        path = \"/\"\n    # Could do syntax based normalization of the URI before\n    # computing the digest. See Section 6.2.2 of Std 66.\n    request_uri = query and \"?\".join([path, query]) or path\n    scheme = scheme.lower()\n    defrag_uri = scheme + \"://\" + authority + request_uri\n    return scheme, authority, request_uri, defrag_uri\n\n\n# Cache filename construction (original borrowed from Venus http://intertwingly.net/code/venus/)\nre_url_scheme    = re.compile(r'^\\w+://')\nre_slash         = re.compile(r'[?/:|]+')\n\ndef safename(filename):\n    \"\"\"Return a filename suitable for the cache.\n\n    Strips dangerous and common characters to create a filename we\n    can use to store the cache in.\n    \"\"\"\n\n    try:\n        if re_url_scheme.match(filename):\n            if isinstance(filename,str):\n                filename = filename.decode('utf-8')\n                filename = filename.encode('idna')\n            else:\n                filename = filename.encode('idna')\n    except UnicodeError:\n        pass\n    if isinstance(filename,unicode):\n        filename=filename.encode('utf-8')\n    filemd5 = _md5(filename).hexdigest()\n    filename = re_url_scheme.sub(\"\", filename)\n    filename = re_slash.sub(\",\", filename)\n\n    # limit length of filename\n    if len(filename)>200:\n        filename=filename[:200]\n    return \",\".join((filename, filemd5))\n\nNORMALIZE_SPACE = re.compile(r'(?:\\r\\n)?[ \\t]+')\ndef _normalize_headers(headers):\n    return dict([ (key.lower(), NORMALIZE_SPACE.sub(value, ' ').strip())  for (key, value) in headers.iteritems()])\n\ndef _parse_cache_control(headers):\n    retval = {}\n    if headers.has_key('cache-control'):\n        parts =  headers['cache-control'].split(',')\n        parts_with_args = [tuple([x.strip().lower() for x in part.split(\"=\", 1)]) for part in parts if -1 != part.find(\"=\")]\n        parts_wo_args = [(name.strip().lower(), 1) for name in parts if -1 == name.find(\"=\")]\n        retval = dict(parts_with_args + parts_wo_args)\n    return retval\n\n# Whether to use a strict mode to parse WWW-Authenticate headers\n# Might lead to bad results in case of ill-formed header value,\n# so disabled by default, falling back to relaxed parsing.\n# Set to true to turn on, usefull for testing servers.\nUSE_WWW_AUTH_STRICT_PARSING = 0\n\n# In regex below:\n#    [^\\0-\\x1f\\x7f-\\xff()<>@,;:\\\\\\\"/[\\]?={} \\t]+             matches a \"token\" as defined by HTTP\n#    \"(?:[^\\0-\\x08\\x0A-\\x1f\\x7f-\\xff\\\\\\\"]|\\\\[\\0-\\x7f])*?\"    matches a \"quoted-string\" as defined by HTTP, when LWS have already been replaced by a single space\n# Actually, as an auth-param value can be either a token or a quoted-string, they are combined in a single pattern which matches both:\n#    \\\"?((?<=\\\")(?:[^\\0-\\x1f\\x7f-\\xff\\\\\\\"]|\\\\[\\0-\\x7f])*?(?=\\\")|(?<!\\\")[^\\0-\\x08\\x0A-\\x1f\\x7f-\\xff()<>@,;:\\\\\\\"/[\\]?={} \\t]+(?!\\\"))\\\"?\nWWW_AUTH_STRICT = re.compile(r\"^(?:\\s*(?:,\\s*)?([^\\0-\\x1f\\x7f-\\xff()<>@,;:\\\\\\\"/[\\]?={} \\t]+)\\s*=\\s*\\\"?((?<=\\\")(?:[^\\0-\\x08\\x0A-\\x1f\\x7f-\\xff\\\\\\\"]|\\\\[\\0-\\x7f])*?(?=\\\")|(?<!\\\")[^\\0-\\x1f\\x7f-\\xff()<>@,;:\\\\\\\"/[\\]?={} \\t]+(?!\\\"))\\\"?)(.*)$\")\nWWW_AUTH_RELAXED = re.compile(r\"^(?:\\s*(?:,\\s*)?([^ \\t\\r\\n=]+)\\s*=\\s*\\\"?((?<=\\\")(?:[^\\\\\\\"]|\\\\.)*?(?=\\\")|(?<!\\\")[^ \\t\\r\\n,]+(?!\\\"))\\\"?)(.*)$\")\nUNQUOTE_PAIRS = re.compile(r'\\\\(.)')\ndef _parse_www_authenticate(headers, headername='www-authenticate'):\n    \"\"\"Returns a dictionary of dictionaries, one dict\n    per auth_scheme.\"\"\"\n    retval = {}\n    if headers.has_key(headername):\n        try:\n          authenticate = headers[headername].strip()\n          www_auth = USE_WWW_AUTH_STRICT_PARSING and WWW_AUTH_STRICT or WWW_AUTH_RELAXED\n          while authenticate:\n              # Break off the scheme at the beginning of the line\n              if headername == 'authentication-info':\n                  (auth_scheme, the_rest) = ('digest', authenticate)\n              else:\n                  (auth_scheme, the_rest) = authenticate.split(\" \", 1)\n              # Now loop over all the key value pairs that come after the scheme,\n              # being careful not to roll into the next scheme\n              match = www_auth.search(the_rest)\n              auth_params = {}\n              while match:\n                  if match and len(match.groups()) == 3:\n                      (key, value, the_rest) = match.groups()\n                      auth_params[key.lower()] = UNQUOTE_PAIRS.sub(r'\\1', value) # '\\\\'.join([x.replace('\\\\', '') for x in value.split('\\\\\\\\')])\n                  match = www_auth.search(the_rest)\n              retval[auth_scheme.lower()] = auth_params\n              authenticate = the_rest.strip()\n        except ValueError:\n          raise MalformedHeader(\"WWW-Authenticate\")\n    return retval\n\n\ndef _entry_disposition(response_headers, request_headers):\n    \"\"\"Determine freshness from the Date, Expires and Cache-Control headers.\n\n    We don't handle the following:\n\n    1. Cache-Control: max-stale\n    2. Age: headers are not used in the calculations.\n\n    Not that this algorithm is simpler than you might think\n    because we are operating as a private (non-shared) cache.\n    This lets us ignore 's-maxage'. We can also ignore\n    'proxy-invalidate' since we aren't a proxy.\n    We will never return a stale document as\n    fresh as a design decision, and thus the non-implementation\n    of 'max-stale'. This also lets us safely ignore 'must-revalidate'\n    since we operate as if every server has sent 'must-revalidate'.\n    Since we are private we get to ignore both 'public' and\n    'private' parameters. We also ignore 'no-transform' since\n    we don't do any transformations.\n    The 'no-store' parameter is handled at a higher level.\n    So the only Cache-Control parameters we look at are:\n\n    no-cache\n    only-if-cached\n    max-age\n    min-fresh\n    \"\"\"\n\n    retval = \"STALE\"\n    cc = _parse_cache_control(request_headers)\n    cc_response = _parse_cache_control(response_headers)\n\n    if request_headers.has_key('pragma') and request_headers['pragma'].lower().find('no-cache') != -1:\n        retval = \"TRANSPARENT\"\n        if 'cache-control' not in request_headers:\n            request_headers['cache-control'] = 'no-cache'\n    elif cc.has_key('no-cache'):\n        retval = \"TRANSPARENT\"\n    elif cc_response.has_key('no-cache'):\n        retval = \"STALE\"\n    elif cc.has_key('only-if-cached'):\n        retval = \"FRESH\"\n    elif response_headers.has_key('date'):\n        date = calendar.timegm(email.Utils.parsedate_tz(response_headers['date']))\n        now = time.time()\n        current_age = max(0, now - date)\n        if cc_response.has_key('max-age'):\n            try:\n                freshness_lifetime = int(cc_response['max-age'])\n            except ValueError:\n                freshness_lifetime = 0\n        elif response_headers.has_key('expires'):\n            expires = email.Utils.parsedate_tz(response_headers['expires'])\n            if None == expires:\n                freshness_lifetime = 0\n            else:\n                freshness_lifetime = max(0, calendar.timegm(expires) - date)\n        else:\n            freshness_lifetime = 0\n        if cc.has_key('max-age'):\n            try:\n                freshness_lifetime = int(cc['max-age'])\n            except ValueError:\n                freshness_lifetime = 0\n        if cc.has_key('min-fresh'):\n            try:\n                min_fresh = int(cc['min-fresh'])\n            except ValueError:\n                min_fresh = 0\n            current_age += min_fresh\n        if freshness_lifetime > current_age:\n            retval = \"FRESH\"\n    return retval\n\ndef _decompressContent(response, new_content):\n    content = new_content\n    try:\n        encoding = response.get('content-encoding', None)\n        if encoding in ['gzip', 'deflate']:\n            if encoding == 'gzip':\n                content = gzip.GzipFile(fileobj=StringIO.StringIO(new_content)).read()\n            if encoding == 'deflate':\n                content = zlib.decompress(content)\n            response['content-length'] = str(len(content))\n            # Record the historical presence of the encoding in a way the won't interfere.\n            response['-content-encoding'] = response['content-encoding']\n            del response['content-encoding']\n    except IOError:\n        content = \"\"\n        raise FailedToDecompressContent(_(\"Content purported to be compressed with %s but failed to decompress.\") % response.get('content-encoding'), response, content)\n    return content\n\ndef _updateCache(request_headers, response_headers, content, cache, cachekey):\n    if cachekey:\n        cc = _parse_cache_control(request_headers)\n        cc_response = _parse_cache_control(response_headers)\n        if cc.has_key('no-store') or cc_response.has_key('no-store'):\n            cache.delete(cachekey)\n        else:\n            info = email.Message.Message()\n            for key, value in response_headers.iteritems():\n                if key not in ['status','content-encoding','transfer-encoding']:\n                    info[key] = value\n\n            # Add annotations to the cache to indicate what headers\n            # are variant for this request.\n            vary = response_headers.get('vary', None)\n            if vary:\n                vary_headers = vary.lower().replace(' ', '').split(',')\n                for header in vary_headers:\n                    key = '-varied-%s' % header\n                    try:\n                        info[key] = request_headers[header]\n                    except KeyError:\n                        pass\n\n            status = response_headers.status\n            if status == 304:\n                status = 200\n\n            status_header = 'status: %d\\r\\n' % status\n\n            header_str = info.as_string()\n\n            header_str = re.sub(\"\\r(?!\\n)|(?<!\\r)\\n\", \"\\r\\n\", header_str)\n            text = \"\".join([status_header, header_str, content])\n\n            cache.set(cachekey, text)\n\ndef _cnonce():\n    dig = _md5(\"%s:%s\" % (time.ctime(), [\"0123456789\"[random.randrange(0, 9)] for i in range(20)])).hexdigest()\n    return dig[:16]\n\ndef _wsse_username_token(cnonce, iso_now, password):\n    return base64.b64encode(_sha(\"%s%s%s\" % (cnonce, iso_now, password)).digest()).strip()\n\n\n# For credentials we need two things, first\n# a pool of credential to try (not necesarily tied to BAsic, Digest, etc.)\n# Then we also need a list of URIs that have already demanded authentication\n# That list is tricky since sub-URIs can take the same auth, or the\n# auth scheme may change as you descend the tree.\n# So we also need each Auth instance to be able to tell us\n# how close to the 'top' it is.\n\nclass Authentication(object):\n    def __init__(self, credentials, host, request_uri, headers, response, content, http):\n        (scheme, authority, path, query, fragment) = parse_uri(request_uri)\n        self.path = path\n        self.host = host\n        self.credentials = credentials\n        self.http = http\n\n    def depth(self, request_uri):\n        (scheme, authority, path, query, fragment) = parse_uri(request_uri)\n        return request_uri[len(self.path):].count(\"/\")\n\n    def inscope(self, host, request_uri):\n        # XXX Should we normalize the request_uri?\n        (scheme, authority, path, query, fragment) = parse_uri(request_uri)\n        return (host == self.host) and path.startswith(self.path)\n\n    def request(self, method, request_uri, headers, content):\n        \"\"\"Modify the request headers to add the appropriate\n        Authorization header. Over-ride this in sub-classes.\"\"\"\n        pass\n\n    def response(self, response, content):\n        \"\"\"Gives us a chance to update with new nonces\n        or such returned from the last authorized response.\n        Over-rise this in sub-classes if necessary.\n\n        Return TRUE is the request is to be retried, for\n        example Digest may return stale=true.\n        \"\"\"\n        return False\n\n\n\nclass BasicAuthentication(Authentication):\n    def __init__(self, credentials, host, request_uri, headers, response, content, http):\n        Authentication.__init__(self, credentials, host, request_uri, headers, response, content, http)\n\n    def request(self, method, request_uri, headers, content):\n        \"\"\"Modify the request headers to add the appropriate\n        Authorization header.\"\"\"\n        headers['authorization'] = 'Basic ' + base64.b64encode(\"%s:%s\" % self.credentials).strip()\n\n\nclass DigestAuthentication(Authentication):\n    \"\"\"Only do qop='auth' and MD5, since that\n    is all Apache currently implements\"\"\"\n    def __init__(self, credentials, host, request_uri, headers, response, content, http):\n        Authentication.__init__(self, credentials, host, request_uri, headers, response, content, http)\n        challenge = _parse_www_authenticate(response, 'www-authenticate')\n        self.challenge = challenge['digest']\n        qop = self.challenge.get('qop', 'auth')\n        self.challenge['qop'] = ('auth' in [x.strip() for x in qop.split()]) and 'auth' or None\n        if self.challenge['qop'] is None:\n            raise UnimplementedDigestAuthOptionError( _(\"Unsupported value for qop: %s.\" % qop))\n        self.challenge['algorithm'] = self.challenge.get('algorithm', 'MD5').upper()\n        if self.challenge['algorithm'] != 'MD5':\n            raise UnimplementedDigestAuthOptionError( _(\"Unsupported value for algorithm: %s.\" % self.challenge['algorithm']))\n        self.A1 = \"\".join([self.credentials[0], \":\", self.challenge['realm'], \":\", self.credentials[1]])\n        self.challenge['nc'] = 1\n\n    def request(self, method, request_uri, headers, content, cnonce = None):\n        \"\"\"Modify the request headers\"\"\"\n        H = lambda x: _md5(x).hexdigest()\n        KD = lambda s, d: H(\"%s:%s\" % (s, d))\n        A2 = \"\".join([method, \":\", request_uri])\n        self.challenge['cnonce'] = cnonce or _cnonce()\n        request_digest  = '\"%s\"' % KD(H(self.A1), \"%s:%s:%s:%s:%s\" % (self.challenge['nonce'],\n                    '%08x' % self.challenge['nc'],\n                    self.challenge['cnonce'],\n                    self.challenge['qop'], H(A2)\n                    ))\n        headers['authorization'] = 'Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", algorithm=%s, response=%s, qop=%s, nc=%08x, cnonce=\"%s\"' % (\n                self.credentials[0],\n                self.challenge['realm'],\n                self.challenge['nonce'],\n                request_uri,\n                self.challenge['algorithm'],\n                request_digest,\n                self.challenge['qop'],\n                self.challenge['nc'],\n                self.challenge['cnonce'],\n                )\n        if self.challenge.get('opaque'):\n            headers['authorization'] += ', opaque=\"%s\"' % self.challenge['opaque']\n        self.challenge['nc'] += 1\n\n    def response(self, response, content):\n        if not response.has_key('authentication-info'):\n            challenge = _parse_www_authenticate(response, 'www-authenticate').get('digest', {})\n            if 'true' == challenge.get('stale'):\n                self.challenge['nonce'] = challenge['nonce']\n                self.challenge['nc'] = 1\n                return True\n        else:\n            updated_challenge = _parse_www_authenticate(response, 'authentication-info').get('digest', {})\n\n            if updated_challenge.has_key('nextnonce'):\n                self.challenge['nonce'] = updated_challenge['nextnonce']\n                self.challenge['nc'] = 1\n        return False\n\n\nclass HmacDigestAuthentication(Authentication):\n    \"\"\"Adapted from Robert Sayre's code and DigestAuthentication above.\"\"\"\n    __author__ = \"Thomas Broyer (t.broyer@ltgt.net)\"\n\n    def __init__(self, credentials, host, request_uri, headers, response, content, http):\n        Authentication.__init__(self, credentials, host, request_uri, headers, response, content, http)\n        challenge = _parse_www_authenticate(response, 'www-authenticate')\n        self.challenge = challenge['hmacdigest']\n        # TODO: self.challenge['domain']\n        self.challenge['reason'] = self.challenge.get('reason', 'unauthorized')\n        if self.challenge['reason'] not in ['unauthorized', 'integrity']:\n            self.challenge['reason'] = 'unauthorized'\n        self.challenge['salt'] = self.challenge.get('salt', '')\n        if not self.challenge.get('snonce'):\n            raise UnimplementedHmacDigestAuthOptionError( _(\"The challenge doesn't contain a server nonce, or this one is empty.\"))\n        self.challenge['algorithm'] = self.challenge.get('algorithm', 'HMAC-SHA-1')\n        if self.challenge['algorithm'] not in ['HMAC-SHA-1', 'HMAC-MD5']:\n            raise UnimplementedHmacDigestAuthOptionError( _(\"Unsupported value for algorithm: %s.\" % self.challenge['algorithm']))\n        self.challenge['pw-algorithm'] = self.challenge.get('pw-algorithm', 'SHA-1')\n        if self.challenge['pw-algorithm'] not in ['SHA-1', 'MD5']:\n            raise UnimplementedHmacDigestAuthOptionError( _(\"Unsupported value for pw-algorithm: %s.\" % self.challenge['pw-algorithm']))\n        if self.challenge['algorithm'] == 'HMAC-MD5':\n            self.hashmod = _md5\n        else:\n            self.hashmod = _sha\n        if self.challenge['pw-algorithm'] == 'MD5':\n            self.pwhashmod = _md5\n        else:\n            self.pwhashmod = _sha\n        self.key = \"\".join([self.credentials[0], \":\",\n                    self.pwhashmod.new(\"\".join([self.credentials[1], self.challenge['salt']])).hexdigest().lower(),\n                    \":\", self.challenge['realm']\n                    ])\n        self.key = self.pwhashmod.new(self.key).hexdigest().lower()\n\n    def request(self, method, request_uri, headers, content):\n        \"\"\"Modify the request headers\"\"\"\n        keys = _get_end2end_headers(headers)\n        keylist = \"\".join([\"%s \" % k for k in keys])\n        headers_val = \"\".join([headers[k] for k in keys])\n        created = time.strftime('%Y-%m-%dT%H:%M:%SZ',time.gmtime())\n        cnonce = _cnonce()\n        request_digest = \"%s:%s:%s:%s:%s\" % (method, request_uri, cnonce, self.challenge['snonce'], headers_val)\n        request_digest  = hmac.new(self.key, request_digest, self.hashmod).hexdigest().lower()\n        headers['authorization'] = 'HMACDigest username=\"%s\", realm=\"%s\", snonce=\"%s\", cnonce=\"%s\", uri=\"%s\", created=\"%s\", response=\"%s\", headers=\"%s\"' % (\n                self.credentials[0],\n                self.challenge['realm'],\n                self.challenge['snonce'],\n                cnonce,\n                request_uri,\n                created,\n                request_digest,\n                keylist,\n                )\n\n    def response(self, response, content):\n        challenge = _parse_www_authenticate(response, 'www-authenticate').get('hmacdigest', {})\n        if challenge.get('reason') in ['integrity', 'stale']:\n            return True\n        return False\n\n\nclass WsseAuthentication(Authentication):\n    \"\"\"This is thinly tested and should not be relied upon.\n    At this time there isn't any third party server to test against.\n    Blogger and TypePad implemented this algorithm at one point\n    but Blogger has since switched to Basic over HTTPS and\n    TypePad has implemented it wrong, by never issuing a 401\n    challenge but instead requiring your client to telepathically know that\n    their endpoint is expecting WSSE profile=\"UsernameToken\".\"\"\"\n    def __init__(self, credentials, host, request_uri, headers, response, content, http):\n        Authentication.__init__(self, credentials, host, request_uri, headers, response, content, http)\n\n    def request(self, method, request_uri, headers, content):\n        \"\"\"Modify the request headers to add the appropriate\n        Authorization header.\"\"\"\n        headers['authorization'] = 'WSSE profile=\"UsernameToken\"'\n        iso_now = time.strftime(\"%Y-%m-%dT%H:%M:%SZ\", time.gmtime())\n        cnonce = _cnonce()\n        password_digest = _wsse_username_token(cnonce, iso_now, self.credentials[1])\n        headers['X-WSSE'] = 'UsernameToken Username=\"%s\", PasswordDigest=\"%s\", Nonce=\"%s\", Created=\"%s\"' % (\n                self.credentials[0],\n                password_digest,\n                cnonce,\n                iso_now)\n\nclass GoogleLoginAuthentication(Authentication):\n    def __init__(self, credentials, host, request_uri, headers, response, content, http):\n        from urllib import urlencode\n        Authentication.__init__(self, credentials, host, request_uri, headers, response, content, http)\n        challenge = _parse_www_authenticate(response, 'www-authenticate')\n        service = challenge['googlelogin'].get('service', 'xapi')\n        # Bloggger actually returns the service in the challenge\n        # For the rest we guess based on the URI\n        if service == 'xapi' and  request_uri.find(\"calendar\") > 0:\n            service = \"cl\"\n        # No point in guessing Base or Spreadsheet\n        #elif request_uri.find(\"spreadsheets\") > 0:\n        #    service = \"wise\"\n\n        auth = dict(Email=credentials[0], Passwd=credentials[1], service=service, source=headers['user-agent'])\n        resp, content = self.http.request(\"https://www.google.com/accounts/ClientLogin\", method=\"POST\", body=urlencode(auth), headers={'Content-Type': 'application/x-www-form-urlencoded'})\n        lines = content.split('\\n')\n        d = dict([tuple(line.split(\"=\", 1)) for line in lines if line])\n        if resp.status == 403:\n            self.Auth = \"\"\n        else:\n            self.Auth = d['Auth']\n\n    def request(self, method, request_uri, headers, content):\n        \"\"\"Modify the request headers to add the appropriate\n        Authorization header.\"\"\"\n        headers['authorization'] = 'GoogleLogin Auth=' + self.Auth\n\n\nAUTH_SCHEME_CLASSES = {\n    \"basic\": BasicAuthentication,\n    \"wsse\": WsseAuthentication,\n    \"digest\": DigestAuthentication,\n    \"hmacdigest\": HmacDigestAuthentication,\n    \"googlelogin\": GoogleLoginAuthentication\n}\n\nAUTH_SCHEME_ORDER = [\"hmacdigest\", \"googlelogin\", \"digest\", \"wsse\", \"basic\"]\n\nclass FileCache(object):\n    \"\"\"Uses a local directory as a store for cached files.\n    Not really safe to use if multiple threads or processes are going to\n    be running on the same cache.\n    \"\"\"\n    def __init__(self, cache, safe=safename): # use safe=lambda x: md5.new(x).hexdigest() for the old behavior\n        self.cache = cache\n        self.safe = safe\n        if not os.path.exists(cache):\n            os.makedirs(self.cache)\n\n    def get(self, key):\n        retval = None\n        cacheFullPath = os.path.join(self.cache, self.safe(key))\n        try:\n            f = file(cacheFullPath, \"rb\")\n            retval = f.read()\n            f.close()\n        except IOError:\n            pass\n        return retval\n\n    def set(self, key, value):\n        cacheFullPath = os.path.join(self.cache, self.safe(key))\n        f = file(cacheFullPath, \"wb\")\n        f.write(value)\n        f.close()\n\n    def delete(self, key):\n        cacheFullPath = os.path.join(self.cache, self.safe(key))\n        if os.path.exists(cacheFullPath):\n            os.remove(cacheFullPath)\n\nclass Credentials(object):\n    def __init__(self):\n        self.credentials = []\n\n    def add(self, name, password, domain=\"\"):\n        self.credentials.append((domain.lower(), name, password))\n\n    def clear(self):\n        self.credentials = []\n\n    def iter(self, domain):\n        for (cdomain, name, password) in self.credentials:\n            if cdomain == \"\" or domain == cdomain:\n                yield (name, password)\n\nclass KeyCerts(Credentials):\n    \"\"\"Identical to Credentials except that\n    name/password are mapped to key/cert.\"\"\"\n    pass\n\nclass AllHosts(object):\n  pass\n\nclass ProxyInfo(object):\n    \"\"\"Collect information required to use a proxy.\"\"\"\n    bypass_hosts = ()\n\n    def __init__(self, proxy_type, proxy_host, proxy_port,\n        proxy_rdns=None, proxy_user=None, proxy_pass=None):\n        \"\"\"The parameter proxy_type must be set to one of socks.PROXY_TYPE_XXX\n        constants. For example:\n\n        p = ProxyInfo(proxy_type=socks.PROXY_TYPE_HTTP,\n            proxy_host='localhost', proxy_port=8000)\n        \"\"\"\n        self.proxy_type = proxy_type\n        self.proxy_host = proxy_host\n        self.proxy_port = proxy_port\n        self.proxy_rdns = proxy_rdns\n        self.proxy_user = proxy_user\n        self.proxy_pass = proxy_pass\n\n    def astuple(self):\n        return (self.proxy_type, self.proxy_host, self.proxy_port,\n            self.proxy_rdns, self.proxy_user, self.proxy_pass)\n\n    def isgood(self):\n        return (self.proxy_host != None) and (self.proxy_port != None)\n\n    @classmethod\n    def from_environment(cls, method='http'):\n        \"\"\"\n        Read proxy info from the environment variables.\n        \"\"\"\n        if method not in ['http', 'https']:\n          return\n\n        env_var = method + '_proxy'\n        url = os.environ.get(env_var, os.environ.get(env_var.upper()))\n        if not url:\n          return\n        pi = cls.from_url(url, method)\n\n        no_proxy = os.environ.get('no_proxy', os.environ.get('NO_PROXY', ''))\n        bypass_hosts = []\n        if no_proxy:\n          bypass_hosts = no_proxy.split(',')\n        # special case, no_proxy=* means all hosts bypassed\n        if no_proxy == '*':\n          bypass_hosts = AllHosts\n\n        pi.bypass_hosts = bypass_hosts\n        return pi\n\n    @classmethod\n    def from_url(cls, url, method='http'):\n        \"\"\"\n        Construct a ProxyInfo from a URL (such as http_proxy env var)\n        \"\"\"\n        url = urlparse.urlparse(url)\n        username = None\n        password = None\n        port = None\n        if '@' in url[1]:\n          ident, host_port = url[1].split('@', 1)\n          if ':' in ident:\n            username, password = ident.split(':', 1)\n          else:\n            password = ident\n        else:\n          host_port = url[1]\n        if ':' in host_port:\n          host, port = host_port.split(':', 1)\n        else:\n          host = host_port\n\n        if port:\n            port = int(port)\n        else:\n            port = dict(https=443, http=80)[method]\n\n        proxy_type = 3 # socks.PROXY_TYPE_HTTP\n        return cls(\n            proxy_type = proxy_type,\n            proxy_host = host,\n            proxy_port = port,\n            proxy_user = username or None,\n            proxy_pass = password or None,\n        )\n\n    def applies_to(self, hostname):\n        return not self.bypass_host(hostname)\n\n    def bypass_host(self, hostname):\n        \"\"\"Has this host been excluded from the proxy config\"\"\"\n        if self.bypass_hosts is AllHosts:\n          return True\n\n        bypass = False\n        for domain in self.bypass_hosts:\n          if hostname.endswith(domain):\n            bypass = True\n\n        return bypass\n\n\nclass HTTPConnectionWithTimeout(httplib.HTTPConnection):\n    \"\"\"\n    HTTPConnection subclass that supports timeouts\n\n    All timeouts are in seconds. If None is passed for timeout then\n    Python's default timeout for sockets will be used. See for example\n    the docs of socket.setdefaulttimeout():\n    http://docs.python.org/library/socket.html#socket.setdefaulttimeout\n    \"\"\"\n\n    def __init__(self, host, port=None, strict=None, timeout=None, proxy_info=None):\n        httplib.HTTPConnection.__init__(self, host, port, strict)\n        self.timeout = timeout\n        self.proxy_info = proxy_info\n\n    def connect(self):\n        \"\"\"Connect to the host and port specified in __init__.\"\"\"\n        # Mostly verbatim from httplib.py.\n        if self.proxy_info and socks is None:\n            raise ProxiesUnavailableError(\n                'Proxy support missing but proxy use was requested!')\n        msg = \"getaddrinfo returns an empty list\"\n        if self.proxy_info and self.proxy_info.isgood():\n            use_proxy = True\n            proxy_type, proxy_host, proxy_port, proxy_rdns, proxy_user, proxy_pass = self.proxy_info.astuple()\n        else:\n            use_proxy = False\n        if use_proxy and proxy_rdns:\n            host = proxy_host\n            port = proxy_port\n        else:\n            host = self.host\n            port = self.port\n\n        for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):\n            af, socktype, proto, canonname, sa = res\n            try:\n                if use_proxy:\n                    self.sock = socks.socksocket(af, socktype, proto)\n                    self.sock.setproxy(proxy_type, proxy_host, proxy_port, proxy_rdns, proxy_user, proxy_pass)\n                else:\n                    self.sock = socket.socket(af, socktype, proto)\n                    self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)\n                # Different from httplib: support timeouts.\n                if has_timeout(self.timeout):\n                    self.sock.settimeout(self.timeout)\n                    # End of difference from httplib.\n                if self.debuglevel > 0:\n                    print \"connect: (%s, %s) ************\" % (self.host, self.port)\n                    if use_proxy:\n                        print \"proxy: %s ************\" % str((proxy_host, proxy_port, proxy_rdns, proxy_user, proxy_pass))\n\n                self.sock.connect((self.host, self.port) + sa[2:])\n            except socket.error, msg:\n                if self.debuglevel > 0:\n                    print \"connect fail: (%s, %s)\" % (self.host, self.port)\n                    if use_proxy:\n                        print \"proxy: %s\" % str((proxy_host, proxy_port, proxy_rdns, proxy_user, proxy_pass))\n                if self.sock:\n                    self.sock.close()\n                self.sock = None\n                continue\n            break\n        if not self.sock:\n            raise socket.error, msg\n\nclass HTTPSConnectionWithTimeout(httplib.HTTPSConnection):\n    \"\"\"\n    This class allows communication via SSL.\n\n    All timeouts are in seconds. If None is passed for timeout then\n    Python's default timeout for sockets will be used. See for example\n    the docs of socket.setdefaulttimeout():\n    http://docs.python.org/library/socket.html#socket.setdefaulttimeout\n    \"\"\"\n    def __init__(self, host, port=None, key_file=None, cert_file=None,\n                 strict=None, timeout=None, proxy_info=None,\n                 ca_certs=None, disable_ssl_certificate_validation=False):\n        httplib.HTTPSConnection.__init__(self, host, port=port, key_file=key_file,\n                cert_file=cert_file, strict=strict)\n        self.timeout = timeout\n        self.proxy_info = proxy_info\n        if ca_certs is None:\n          ca_certs = CA_CERTS\n        self.ca_certs = ca_certs\n        self.disable_ssl_certificate_validation = \\\n                disable_ssl_certificate_validation\n\n    # The following two methods were adapted from https_wrapper.py, released\n    # with the Google Appengine SDK at\n    # http://googleappengine.googlecode.com/svn-history/r136/trunk/python/google/appengine/tools/https_wrapper.py\n    # under the following license:\n    #\n    # Copyright 2007 Google Inc.\n    #\n    # Licensed under the Apache License, Version 2.0 (the \"License\");\n    # you may not use this file except in compliance with the License.\n    # You may obtain a copy of the License at\n    #\n    #     http://www.apache.org/licenses/LICENSE-2.0\n    #\n    # Unless required by applicable law or agreed to in writing, software\n    # distributed under the License is distributed on an \"AS IS\" BASIS,\n    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    # See the License for the specific language governing permissions and\n    # limitations under the License.\n    #\n\n    def _GetValidHostsForCert(self, cert):\n        \"\"\"Returns a list of valid host globs for an SSL certificate.\n\n        Args:\n          cert: A dictionary representing an SSL certificate.\n        Returns:\n          list: A list of valid host globs.\n        \"\"\"\n        if 'subjectAltName' in cert:\n            return [x[1] for x in cert['subjectAltName']\n                    if x[0].lower() == 'dns']\n        else:\n            return [x[0][1] for x in cert['subject']\n                    if x[0][0].lower() == 'commonname']\n\n    def _ValidateCertificateHostname(self, cert, hostname):\n        \"\"\"Validates that a given hostname is valid for an SSL certificate.\n\n        Args:\n          cert: A dictionary representing an SSL certificate.\n          hostname: The hostname to test.\n        Returns:\n          bool: Whether or not the hostname is valid for this certificate.\n        \"\"\"\n        hosts = self._GetValidHostsForCert(cert)\n        for host in hosts:\n            host_re = host.replace('.', '\\.').replace('*', '[^.]*')\n            if re.search('^%s$' % (host_re,), hostname, re.I):\n                return True\n        return False\n\n    def connect(self):\n        \"Connect to a host on a given (SSL) port.\"\n\n        msg = \"getaddrinfo returns an empty list\"\n        if self.proxy_info and self.proxy_info.isgood():\n            use_proxy = True\n            proxy_type, proxy_host, proxy_port, proxy_rdns, proxy_user, proxy_pass = self.proxy_info.astuple()\n        else:\n            use_proxy = False\n        if use_proxy and proxy_rdns:\n            host = proxy_host\n            port = proxy_port\n        else:\n            host = self.host\n            port = self.port\n\n        for family, socktype, proto, canonname, sockaddr in socket.getaddrinfo(\n            host, port, 0, socket.SOCK_STREAM):\n            try:\n                if use_proxy:\n                    sock = socks.socksocket(family, socktype, proto)\n\n                    sock.setproxy(proxy_type, proxy_host, proxy_port, proxy_rdns, proxy_user, proxy_pass)\n                else:\n                    sock = socket.socket(family, socktype, proto)\n                    sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)\n\n                if has_timeout(self.timeout):\n                    sock.settimeout(self.timeout)\n                sock.connect((self.host, self.port))\n                self.sock =_ssl_wrap_socket(\n                    sock, self.key_file, self.cert_file,\n                    self.disable_ssl_certificate_validation, self.ca_certs)\n                if self.debuglevel > 0:\n                    print \"connect: (%s, %s)\" % (self.host, self.port)\n                    if use_proxy:\n                        print \"proxy: %s\" % str((proxy_host, proxy_port, proxy_rdns, proxy_user, proxy_pass))\n                if not self.disable_ssl_certificate_validation:\n                    cert = self.sock.getpeercert()\n                    hostname = self.host.split(':', 0)[0]\n                    if not self._ValidateCertificateHostname(cert, hostname):\n                        raise CertificateHostnameMismatch(\n                            'Server presented certificate that does not match '\n                            'host %s: %s' % (hostname, cert), hostname, cert)\n            except ssl_SSLError, e:\n                if sock:\n                    sock.close()\n                if self.sock:\n                    self.sock.close()\n                self.sock = None\n                # Unfortunately the ssl module doesn't seem to provide any way\n                # to get at more detailed error information, in particular\n                # whether the error is due to certificate validation or\n                # something else (such as SSL protocol mismatch).\n                if e.errno == ssl.SSL_ERROR_SSL:\n                    raise SSLHandshakeError(e)\n                else:\n                    raise\n            except (socket.timeout, socket.gaierror):\n              raise\n            except socket.error, msg:\n              if self.debuglevel > 0:\n                  print \"connect fail: (%s, %s)\" % (self.host, self.port)\n                  if use_proxy:\n                      print \"proxy: %s\" % str((proxy_host, proxy_port, proxy_rdns, proxy_user, proxy_pass))\n              if self.sock:\n                  self.sock.close()\n              self.sock = None\n              continue\n            break\n        if not self.sock:\n          raise socket.error, msg\n\nSCHEME_TO_CONNECTION = {\n    'http': HTTPConnectionWithTimeout,\n    'https': HTTPSConnectionWithTimeout\n    }\n\n# Use a different connection object for Google App Engine\ntry:\n  from google.appengine.api import apiproxy_stub_map\n  if apiproxy_stub_map.apiproxy.GetStub('urlfetch') is None:\n    raise ImportError  # Bail out; we're not actually running on App Engine.\n  from google.appengine.api.urlfetch import fetch\n  from google.appengine.api.urlfetch import InvalidURLError\n  from google.appengine.api.urlfetch import DownloadError\n  from google.appengine.api.urlfetch import ResponseTooLargeError\n  from google.appengine.api.urlfetch import SSLCertificateError\n\n\n  class ResponseDict(dict):\n    \"\"\"Is a dictionary that also has a read() method, so\n    that it can pass itself off as an httlib.HTTPResponse().\"\"\"\n    def read(self):\n      pass\n\n\n  class AppEngineHttpConnection(object):\n    \"\"\"Emulates an httplib.HTTPConnection object, but actually uses the Google\n    App Engine urlfetch library. This allows the timeout to be properly used on\n    Google App Engine, and avoids using httplib, which on Google App Engine is\n    just another wrapper around urlfetch.\n    \"\"\"\n    def __init__(self, host, port=None, key_file=None, cert_file=None,\n                 strict=None, timeout=None, proxy_info=None, ca_certs=None,\n                 disable_ssl_certificate_validation=False):\n      self.host = host\n      self.port = port\n      self.timeout = timeout\n      if key_file or cert_file or proxy_info or ca_certs:\n        raise NotSupportedOnThisPlatform()\n      self.response = None\n      self.scheme = 'http'\n      self.validate_certificate = not disable_ssl_certificate_validation\n      self.sock = True\n\n    def request(self, method, url, body, headers):\n      # Calculate the absolute URI, which fetch requires\n      netloc = self.host\n      if self.port:\n        netloc = '%s:%s' % (self.host, self.port)\n      absolute_uri = '%s://%s%s' % (self.scheme, netloc, url)\n      try:\n        try: # 'body' can be a stream.\n          body = body.read()\n        except AttributeError:\n          pass\n        response = fetch(absolute_uri, payload=body, method=method,\n            headers=headers, allow_truncated=False, follow_redirects=False,\n            deadline=self.timeout,\n            validate_certificate=self.validate_certificate)\n        self.response = ResponseDict(response.headers)\n        self.response['status'] = str(response.status_code)\n        self.response['reason'] = httplib.responses.get(response.status_code, 'Ok')\n        self.response.status = response.status_code\n        setattr(self.response, 'read', lambda : response.content)\n\n      # Make sure the exceptions raised match the exceptions expected.\n      except InvalidURLError:\n        raise socket.gaierror('')\n      except (DownloadError, ResponseTooLargeError, SSLCertificateError):\n        raise httplib.HTTPException()\n\n    def getresponse(self):\n      if self.response:\n        return self.response\n      else:\n        raise httplib.HTTPException()\n\n    def set_debuglevel(self, level):\n      pass\n\n    def connect(self):\n      pass\n\n    def close(self):\n      pass\n\n\n  class AppEngineHttpsConnection(AppEngineHttpConnection):\n    \"\"\"Same as AppEngineHttpConnection, but for HTTPS URIs.\"\"\"\n    def __init__(self, host, port=None, key_file=None, cert_file=None,\n                 strict=None, timeout=None, proxy_info=None, ca_certs=None,\n                 disable_ssl_certificate_validation=False):\n      AppEngineHttpConnection.__init__(self, host, port, key_file, cert_file,\n          strict, timeout, proxy_info, ca_certs, disable_ssl_certificate_validation)\n      self.scheme = 'https'\n\n  # Update the connection classes to use the Googel App Engine specific ones.\n  SCHEME_TO_CONNECTION = {\n      'http': AppEngineHttpConnection,\n      'https': AppEngineHttpsConnection\n      }\n\nexcept ImportError:\n  pass\n\n\nclass Http(object):\n    \"\"\"An HTTP client that handles:\n- all methods\n- caching\n- ETags\n- compression,\n- HTTPS\n- Basic\n- Digest\n- WSSE\n\nand more.\n    \"\"\"\n    def __init__(self, cache=None, timeout=None,\n                 proxy_info=ProxyInfo.from_environment,\n                 ca_certs=None, disable_ssl_certificate_validation=False):\n        \"\"\"If 'cache' is a string then it is used as a directory name for\n        a disk cache. Otherwise it must be an object that supports the\n        same interface as FileCache.\n\n        All timeouts are in seconds. If None is passed for timeout\n        then Python's default timeout for sockets will be used. See\n        for example the docs of socket.setdefaulttimeout():\n        http://docs.python.org/library/socket.html#socket.setdefaulttimeout\n\n        `proxy_info` may be:\n          - a callable that takes the http scheme ('http' or 'https') and\n            returns a ProxyInfo instance per request. By default, uses\n            ProxyInfo.from_environment.\n          - a ProxyInfo instance (static proxy config).\n          - None (proxy disabled).\n\n        ca_certs is the path of a file containing root CA certificates for SSL\n        server certificate validation.  By default, a CA cert file bundled with\n        httplib2 is used.\n\n        If disable_ssl_certificate_validation is true, SSL cert validation will\n        not be performed.\n        \"\"\"\n        self.proxy_info = proxy_info\n        self.ca_certs = ca_certs\n        self.disable_ssl_certificate_validation = \\\n                disable_ssl_certificate_validation\n\n        # Map domain name to an httplib connection\n        self.connections = {}\n        # The location of the cache, for now a directory\n        # where cached responses are held.\n        if cache and isinstance(cache, basestring):\n            self.cache = FileCache(cache)\n        else:\n            self.cache = cache\n\n        # Name/password\n        self.credentials = Credentials()\n\n        # Key/cert\n        self.certificates = KeyCerts()\n\n        # authorization objects\n        self.authorizations = []\n\n        # If set to False then no redirects are followed, even safe ones.\n        self.follow_redirects = True\n\n        # Which HTTP methods do we apply optimistic concurrency to, i.e.\n        # which methods get an \"if-match:\" etag header added to them.\n        self.optimistic_concurrency_methods = [\"PUT\", \"PATCH\"]\n\n        # If 'follow_redirects' is True, and this is set to True then\n        # all redirecs are followed, including unsafe ones.\n        self.follow_all_redirects = False\n\n        self.ignore_etag = False\n\n        self.force_exception_to_status_code = False\n\n        self.timeout = timeout\n\n        # Keep Authorization: headers on a redirect.\n        self.forward_authorization_headers = False\n\n    def _auth_from_challenge(self, host, request_uri, headers, response, content):\n        \"\"\"A generator that creates Authorization objects\n           that can be applied to requests.\n        \"\"\"\n        challenges = _parse_www_authenticate(response, 'www-authenticate')\n        for cred in self.credentials.iter(host):\n            for scheme in AUTH_SCHEME_ORDER:\n                if challenges.has_key(scheme):\n                    yield AUTH_SCHEME_CLASSES[scheme](cred, host, request_uri, headers, response, content, self)\n\n    def add_credentials(self, name, password, domain=\"\"):\n        \"\"\"Add a name and password that will be used\n        any time a request requires authentication.\"\"\"\n        self.credentials.add(name, password, domain)\n\n    def add_certificate(self, key, cert, domain):\n        \"\"\"Add a key and cert that will be used\n        any time a request requires authentication.\"\"\"\n        self.certificates.add(key, cert, domain)\n\n    def clear_credentials(self):\n        \"\"\"Remove all the names and passwords\n        that are used for authentication\"\"\"\n        self.credentials.clear()\n        self.authorizations = []\n\n    def _conn_request(self, conn, request_uri, method, body, headers):\n        for i in range(RETRIES):\n            try:\n                if conn.sock is None:\n                  conn.connect()\n                conn.request(method, request_uri, body, headers)\n            except socket.timeout:\n                raise\n            except socket.gaierror:\n                conn.close()\n                raise ServerNotFoundError(\"Unable to find the server at %s\" % conn.host)\n            except ssl_SSLError:\n                conn.close()\n                raise\n            except socket.error, e:\n                err = 0\n                if hasattr(e, 'args'):\n                    err = getattr(e, 'args')[0]\n                else:\n                    err = e.errno\n                if err == errno.ECONNREFUSED: # Connection refused\n                    raise\n            except httplib.HTTPException:\n                # Just because the server closed the connection doesn't apparently mean\n                # that the server didn't send a response.\n                if conn.sock is None:\n                    if i < RETRIES-1:\n                        conn.close()\n                        conn.connect()\n                        continue\n                    else:\n                        conn.close()\n                        raise\n                if i < RETRIES-1:\n                    conn.close()\n                    conn.connect()\n                    continue\n            try:\n                response = conn.getresponse()\n            except (socket.error, httplib.HTTPException):\n                if i < RETRIES-1:\n                    conn.close()\n                    conn.connect()\n                    continue\n                else:\n                    raise\n            else:\n                content = \"\"\n                if method == \"HEAD\":\n                    conn.close()\n                else:\n                    content = response.read()\n                response = Response(response)\n                if method != \"HEAD\":\n                    content = _decompressContent(response, content)\n            break\n        return (response, content)\n\n\n    def _request(self, conn, host, absolute_uri, request_uri, method, body, headers, redirections, cachekey):\n        \"\"\"Do the actual request using the connection object\n        and also follow one level of redirects if necessary\"\"\"\n\n        auths = [(auth.depth(request_uri), auth) for auth in self.authorizations if auth.inscope(host, request_uri)]\n        auth = auths and sorted(auths)[0][1] or None\n        if auth:\n            auth.request(method, request_uri, headers, body)\n\n        (response, content) = self._conn_request(conn, request_uri, method, body, headers)\n\n        if auth:\n            if auth.response(response, body):\n                auth.request(method, request_uri, headers, body)\n                (response, content) = self._conn_request(conn, request_uri, method, body, headers )\n                response._stale_digest = 1\n\n        if response.status == 401:\n            for authorization in self._auth_from_challenge(host, request_uri, headers, response, content):\n                authorization.request(method, request_uri, headers, body)\n                (response, content) = self._conn_request(conn, request_uri, method, body, headers, )\n                if response.status != 401:\n                    self.authorizations.append(authorization)\n                    authorization.response(response, body)\n                    break\n\n        if (self.follow_all_redirects or (method in [\"GET\", \"HEAD\"]) or response.status == 303):\n            if self.follow_redirects and response.status in [300, 301, 302, 303, 307]:\n                # Pick out the location header and basically start from the beginning\n                # remembering first to strip the ETag header and decrement our 'depth'\n                if redirections:\n                    if not response.has_key('location') and response.status != 300:\n                        raise RedirectMissingLocation( _(\"Redirected but the response is missing a Location: header.\"), response, content)\n                    # Fix-up relative redirects (which violate an RFC 2616 MUST)\n                    if response.has_key('location'):\n                        location = response['location']\n                        (scheme, authority, path, query, fragment) = parse_uri(location)\n                        if authority == None:\n                            response['location'] = urlparse.urljoin(absolute_uri, location)\n                    if response.status == 301 and method in [\"GET\", \"HEAD\"]:\n                        response['-x-permanent-redirect-url'] = response['location']\n                        if not response.has_key('content-location'):\n                            response['content-location'] = absolute_uri\n                        _updateCache(headers, response, content, self.cache, cachekey)\n                    if headers.has_key('if-none-match'):\n                        del headers['if-none-match']\n                    if headers.has_key('if-modified-since'):\n                        del headers['if-modified-since']\n                    if 'authorization' in headers and not self.forward_authorization_headers:\n                        del headers['authorization']\n                    if response.has_key('location'):\n                        location = response['location']\n                        old_response = copy.deepcopy(response)\n                        if not old_response.has_key('content-location'):\n                            old_response['content-location'] = absolute_uri\n                        redirect_method = method\n                        if response.status in [302, 303]:\n                            redirect_method = \"GET\"\n                            body = None\n                        (response, content) = self.request(location, redirect_method, body=body, headers = headers, redirections = redirections - 1)\n                        response.previous = old_response\n                else:\n                    raise RedirectLimit(\"Redirected more times than rediection_limit allows.\", response, content)\n            elif response.status in [200, 203] and method in [\"GET\", \"HEAD\"]:\n                # Don't cache 206's since we aren't going to handle byte range requests\n                if not response.has_key('content-location'):\n                    response['content-location'] = absolute_uri\n                _updateCache(headers, response, content, self.cache, cachekey)\n\n        return (response, content)\n\n    def _normalize_headers(self, headers):\n        return _normalize_headers(headers)\n\n# Need to catch and rebrand some exceptions\n# Then need to optionally turn all exceptions into status codes\n# including all socket.* and httplib.* exceptions.\n\n\n    def request(self, uri, method=\"GET\", body=None, headers=None, redirections=DEFAULT_MAX_REDIRECTS, connection_type=None):\n        \"\"\" Performs a single HTTP request.\nThe 'uri' is the URI of the HTTP resource and can begin\nwith either 'http' or 'https'. The value of 'uri' must be an absolute URI.\n\nThe 'method' is the HTTP method to perform, such as GET, POST, DELETE, etc.\nThere is no restriction on the methods allowed.\n\nThe 'body' is the entity body to be sent with the request. It is a string\nobject.\n\nAny extra headers that are to be sent with the request should be provided in the\n'headers' dictionary.\n\nThe maximum number of redirect to follow before raising an\nexception is 'redirections. The default is 5.\n\nThe return value is a tuple of (response, content), the first\nbeing and instance of the 'Response' class, the second being\na string that contains the response entity body.\n        \"\"\"\n        try:\n            if headers is None:\n                headers = {}\n            else:\n                headers = self._normalize_headers(headers)\n\n            if not headers.has_key('user-agent'):\n                headers['user-agent'] = \"Python-httplib2/%s (gzip)\" % __version__\n\n            uri = iri2uri(uri)\n\n            (scheme, authority, request_uri, defrag_uri) = urlnorm(uri)\n            domain_port = authority.split(\":\")[0:2]\n            if len(domain_port) == 2 and domain_port[1] == '443' and scheme == 'http':\n                scheme = 'https'\n                authority = domain_port[0]\n\n            proxy_info = self._get_proxy_info(scheme, authority)\n\n            conn_key = scheme+\":\"+authority\n            if conn_key in self.connections:\n                conn = self.connections[conn_key]\n            else:\n                if not connection_type:\n                  connection_type = SCHEME_TO_CONNECTION[scheme]\n                certs = list(self.certificates.iter(authority))\n                if scheme == 'https':\n                    if certs:\n                        conn = self.connections[conn_key] = connection_type(\n                                authority, key_file=certs[0][0],\n                                cert_file=certs[0][1], timeout=self.timeout,\n                                proxy_info=proxy_info,\n                                ca_certs=self.ca_certs,\n                                disable_ssl_certificate_validation=\n                                        self.disable_ssl_certificate_validation)\n                    else:\n                        conn = self.connections[conn_key] = connection_type(\n                                authority, timeout=self.timeout,\n                                proxy_info=proxy_info,\n                                ca_certs=self.ca_certs,\n                                disable_ssl_certificate_validation=\n                                        self.disable_ssl_certificate_validation)\n                else:\n                    conn = self.connections[conn_key] = connection_type(\n                            authority, timeout=self.timeout,\n                            proxy_info=proxy_info)\n                conn.set_debuglevel(debuglevel)\n\n            if 'range' not in headers and 'accept-encoding' not in headers:\n                headers['accept-encoding'] = 'gzip, deflate'\n\n            info = email.Message.Message()\n            cached_value = None\n            if self.cache:\n                cachekey = defrag_uri\n                cached_value = self.cache.get(cachekey)\n                if cached_value:\n                    # info = email.message_from_string(cached_value)\n                    #\n                    # Need to replace the line above with the kludge below\n                    # to fix the non-existent bug not fixed in this\n                    # bug report: http://mail.python.org/pipermail/python-bugs-list/2005-September/030289.html\n                    try:\n                        info, content = cached_value.split('\\r\\n\\r\\n', 1)\n                        feedparser = email.FeedParser.FeedParser()\n                        feedparser.feed(info)\n                        info = feedparser.close()\n                        feedparser._parse = None\n                    except (IndexError, ValueError):\n                        self.cache.delete(cachekey)\n                        cachekey = None\n                        cached_value = None\n            else:\n                cachekey = None\n\n            if method in self.optimistic_concurrency_methods and self.cache and info.has_key('etag') and not self.ignore_etag and 'if-match' not in headers:\n                # http://www.w3.org/1999/04/Editing/\n                headers['if-match'] = info['etag']\n\n            if method not in [\"GET\", \"HEAD\"] and self.cache and cachekey:\n                # RFC 2616 Section 13.10\n                self.cache.delete(cachekey)\n\n            # Check the vary header in the cache to see if this request\n            # matches what varies in the cache.\n            if method in ['GET', 'HEAD'] and 'vary' in info:\n                vary = info['vary']\n                vary_headers = vary.lower().replace(' ', '').split(',')\n                for header in vary_headers:\n                    key = '-varied-%s' % header\n                    value = info[key]\n                    if headers.get(header, None) != value:\n                            cached_value = None\n                            break\n\n            if cached_value and method in [\"GET\", \"HEAD\"] and self.cache and 'range' not in headers:\n                if info.has_key('-x-permanent-redirect-url'):\n                    # Should cached permanent redirects be counted in our redirection count? For now, yes.\n                    if redirections <= 0:\n                      raise RedirectLimit(\"Redirected more times than rediection_limit allows.\", {}, \"\")\n                    (response, new_content) = self.request(info['-x-permanent-redirect-url'], \"GET\", headers = headers, redirections = redirections - 1)\n                    response.previous = Response(info)\n                    response.previous.fromcache = True\n                else:\n                    # Determine our course of action:\n                    #   Is the cached entry fresh or stale?\n                    #   Has the client requested a non-cached response?\n                    #\n                    # There seems to be three possible answers:\n                    # 1. [FRESH] Return the cache entry w/o doing a GET\n                    # 2. [STALE] Do the GET (but add in cache validators if available)\n                    # 3. [TRANSPARENT] Do a GET w/o any cache validators (Cache-Control: no-cache) on the request\n                    entry_disposition = _entry_disposition(info, headers)\n\n                    if entry_disposition == \"FRESH\":\n                        if not cached_value:\n                            info['status'] = '504'\n                            content = \"\"\n                        response = Response(info)\n                        if cached_value:\n                            response.fromcache = True\n                        return (response, content)\n\n                    if entry_disposition == \"STALE\":\n                        if info.has_key('etag') and not self.ignore_etag and not 'if-none-match' in headers:\n                            headers['if-none-match'] = info['etag']\n                        if info.has_key('last-modified') and not 'last-modified' in headers:\n                            headers['if-modified-since'] = info['last-modified']\n                    elif entry_disposition == \"TRANSPARENT\":\n                        pass\n\n                    (response, new_content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)\n\n                if response.status == 304 and method == \"GET\":\n                    # Rewrite the cache entry with the new end-to-end headers\n                    # Take all headers that are in response\n                    # and overwrite their values in info.\n                    # unless they are hop-by-hop, or are listed in the connection header.\n\n                    for key in _get_end2end_headers(response):\n                        info[key] = response[key]\n                    merged_response = Response(info)\n                    if hasattr(response, \"_stale_digest\"):\n                        merged_response._stale_digest = response._stale_digest\n                    _updateCache(headers, merged_response, content, self.cache, cachekey)\n                    response = merged_response\n                    response.status = 200\n                    response.fromcache = True\n\n                elif response.status == 200:\n                    content = new_content\n                else:\n                    self.cache.delete(cachekey)\n                    content = new_content\n            else:\n                cc = _parse_cache_control(headers)\n                if cc.has_key('only-if-cached'):\n                    info['status'] = '504'\n                    response = Response(info)\n                    content = \"\"\n                else:\n                    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)\n        except Exception, e:\n            if self.force_exception_to_status_code:\n                if isinstance(e, HttpLib2ErrorWithResponse):\n                    response = e.response\n                    content = e.content\n                    response.status = 500\n                    response.reason = str(e)\n                elif isinstance(e, socket.timeout):\n                    content = \"Request Timeout\"\n                    response = Response( {\n                            \"content-type\": \"text/plain\",\n                            \"status\": \"408\",\n                            \"content-length\": len(content)\n                            })\n                    response.reason = \"Request Timeout\"\n                else:\n                    content = str(e)\n                    response = Response( {\n                            \"content-type\": \"text/plain\",\n                            \"status\": \"400\",\n                            \"content-length\": len(content)\n                            })\n                    response.reason = \"Bad Request\"\n            else:\n                raise\n\n\n        return (response, content)\n\n    def _get_proxy_info(self, scheme, authority):\n        \"\"\"Return a ProxyInfo instance (or None) based on the scheme\n        and authority.\n        \"\"\"\n        hostname, port = urllib.splitport(authority)\n        proxy_info = self.proxy_info\n        if callable(proxy_info):\n            proxy_info = proxy_info(scheme)\n\n        if (hasattr(proxy_info, 'applies_to')\n            and not proxy_info.applies_to(hostname)):\n            proxy_info = None\n        return proxy_info\n\n\nclass Response(dict):\n    \"\"\"An object more like email.Message than httplib.HTTPResponse.\"\"\"\n\n    \"\"\"Is this response from our local cache\"\"\"\n    fromcache = False\n\n    \"\"\"HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1. \"\"\"\n    version = 11\n\n    \"Status code returned by server. \"\n    status = 200\n\n    \"\"\"Reason phrase returned by server.\"\"\"\n    reason = \"Ok\"\n\n    previous = None\n\n    def __init__(self, info):\n        # info is either an email.Message or\n        # an httplib.HTTPResponse object.\n        if isinstance(info, httplib.HTTPResponse):\n            for key, value in info.getheaders():\n                self[key.lower()] = value\n            self.status = info.status\n            self['status'] = str(self.status)\n            self.reason = info.reason\n            self.version = info.version\n        elif isinstance(info, email.Message.Message):\n            for key, value in info.items():\n                self[key.lower()] = value\n            self.status = int(self['status'])\n        else:\n            for key, value in info.iteritems():\n                self[key.lower()] = value\n            self.status = int(self.get('status', self.status))\n            self.reason = self.get('reason', self.reason)\n\n\n    def __getattr__(self, name):\n        if name == 'dict':\n            return self\n        else:\n            raise AttributeError, name\n"
  },
  {
    "path": "lib/httplib2/cacerts.txt",
    "content": "# Certifcate Authority certificates for validating SSL connections.\n#\n# This file contains PEM format certificates generated from\n# http://mxr.mozilla.org/seamonkey/source/security/nss/lib/ckfw/builtins/certdata.txt\n#\n# ***** BEGIN LICENSE BLOCK *****\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is the Netscape security libraries.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 1994-2000\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ***** END LICENSE BLOCK *****\n\nVerisign/RSA Secure Server CA\n=============================\n\n-----BEGIN CERTIFICATE-----\nMIICNDCCAaECEAKtZn5ORf5eV288mBle3cAwDQYJKoZIhvcNAQECBQAwXzELMAkG\nA1UEBhMCVVMxIDAeBgNVBAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYD\nVQQLEyVTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk0\nMTEwOTAwMDAwMFoXDTEwMDEwNzIzNTk1OVowXzELMAkGA1UEBhMCVVMxIDAeBgNV\nBAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYDVQQLEyVTZWN1cmUgU2Vy\ndmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGbMA0GCSqGSIb3DQEBAQUAA4GJ\nADCBhQJ+AJLOesGugz5aqomDV6wlAXYMra6OLDfO6zV4ZFQD5YRAUcm/jwjiioII\n0haGN1XpsSECrXZogZoFokvJSyVmIlZsiAeP94FZbYQHZXATcXY+m3dM41CJVphI\nuR2nKRoTLkoRWZweFdVJVCxzOmmCsZc5nG1wZ0jl3S3WyB57AgMBAAEwDQYJKoZI\nhvcNAQECBQADfgBl3X7hsuyw4jrg7HFGmhkRuNPHoLQDQCYCPgmc4RKz0Vr2N6W3\nYQO2WxZpO8ZECAyIUwxrl0nHPjXcbLm7qt9cuzovk2C2qUtN8iD3zV9/ZHuO3ABc\n1/p3yjkWWW8O6tO1g39NTUJWdrTJXwT4OPjr0l91X817/OWOgHz8UA==\n-----END CERTIFICATE-----\n\nThawte Personal Basic CA\n========================\n\n-----BEGIN CERTIFICATE-----\nMIIDITCCAoqgAwIBAgIBADANBgkqhkiG9w0BAQQFADCByzELMAkGA1UEBhMCWkEx\nFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYD\nVQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT\nZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFBlcnNvbmFsIEJhc2lj\nIENBMSgwJgYJKoZIhvcNAQkBFhlwZXJzb25hbC1iYXNpY0B0aGF3dGUuY29tMB4X\nDTk2MDEwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgcsxCzAJBgNVBAYTAlpBMRUw\nEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UE\nChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy\ndmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQZXJzb25hbCBCYXNpYyBD\nQTEoMCYGCSqGSIb3DQEJARYZcGVyc29uYWwtYmFzaWNAdGhhd3RlLmNvbTCBnzAN\nBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvLyTU23AUE+CFeZIlDWmWr5vQvoPR+53\ndXLdjUmbllegeNTKP1GzaQuRdhciB5dqxFGTS+CN7zeVoQxN2jSQHReJl+A1OFdK\nwPQIcOk8RHtQfmGakOMj04gRRif1CwcOu93RfyAKiLlWCy4cgNrx454p7xS9CkT7\nG1sY0b8jkyECAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQF\nAAOBgQAt4plrsD16iddZopQBHyvdEktTwq1/qqcAXJFAVyVKOKqEcLnZgA+le1z7\nc8a914phXAPjLSeoF+CEhULcXpvGt7Jtu3Sv5D/Lp7ew4F2+eIMllNLbgQ95B21P\n9DkVWlIBe94y1k049hJcBlDfBVu9FEuh3ym6O0GN92NWod8isQ==\n-----END CERTIFICATE-----\n\nThawte Personal Premium CA\n==========================\n\n-----BEGIN CERTIFICATE-----\nMIIDKTCCApKgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBzzELMAkGA1UEBhMCWkEx\nFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYD\nVQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT\nZXJ2aWNlcyBEaXZpc2lvbjEjMCEGA1UEAxMaVGhhd3RlIFBlcnNvbmFsIFByZW1p\ndW0gQ0ExKjAoBgkqhkiG9w0BCQEWG3BlcnNvbmFsLXByZW1pdW1AdGhhd3RlLmNv\nbTAeFw05NjAxMDEwMDAwMDBaFw0yMDEyMzEyMzU5NTlaMIHPMQswCQYDVQQGEwJa\nQTEVMBMGA1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xGjAY\nBgNVBAoTEVRoYXd0ZSBDb25zdWx0aW5nMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9u\nIFNlcnZpY2VzIERpdmlzaW9uMSMwIQYDVQQDExpUaGF3dGUgUGVyc29uYWwgUHJl\nbWl1bSBDQTEqMCgGCSqGSIb3DQEJARYbcGVyc29uYWwtcHJlbWl1bUB0aGF3dGUu\nY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJZtn4B0TPuYwu8KHvE0Vs\nBd/eJxZRNkERbGw77f4QfRKe5ZtCmv5gMcNmt3M6SK5O0DI3lIi1DbbZ8/JE2dWI\nEt12TfIa/G8jHnrx2JhFTgcQ7xZC0EN1bUre4qrJMf8fAHB8Zs8QJQi6+u4A6UYD\nZicRFTuqW/KY3TZCstqIdQIDAQABoxMwETAPBgNVHRMBAf8EBTADAQH/MA0GCSqG\nSIb3DQEBBAUAA4GBAGk2ifc0KjNyL2071CKyuG+axTZmDhs8obF1Wub9NdP4qPIH\nb4Vnjt4rueIXsDqg8A6iAJrf8xQVbrvIhVqYgPn/vnQdPfP+MCXRNzRn+qVxeTBh\nKXLA4CxM+1bkOqhv5TJZUtt1KFBZDPgLGeSs2a+WjS9Q2wfD6h+rM+D1KzGJ\n-----END CERTIFICATE-----\n\nThawte Personal Freemail CA\n===========================\n\n-----BEGIN CERTIFICATE-----\nMIIDLTCCApagAwIBAgIBADANBgkqhkiG9w0BAQQFADCB0TELMAkGA1UEBhMCWkEx\nFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYD\nVQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT\nZXJ2aWNlcyBEaXZpc2lvbjEkMCIGA1UEAxMbVGhhd3RlIFBlcnNvbmFsIEZyZWVt\nYWlsIENBMSswKQYJKoZIhvcNAQkBFhxwZXJzb25hbC1mcmVlbWFpbEB0aGF3dGUu\nY29tMB4XDTk2MDEwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgdExCzAJBgNVBAYT\nAlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEa\nMBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRp\nb24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0ZSBQZXJzb25hbCBG\ncmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxAdGhh\nd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1GnX1LCUZFtx6UfY\nDFG26nKRsIRefS0Nj3sS34UldSh0OkIsYyeflXtL734Zhx2G6qPduc6WZBrCFG5E\nrHzmj+hND3EfQDimAKOHePb5lIZererAXnbr2RSjXW56fAylS1V/Bhkpf56aJtVq\nuzgkCGqYx7Hao5iR/Xnb5VrEHLkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zAN\nBgkqhkiG9w0BAQQFAAOBgQDH7JJ+Tvj1lqVnYiqk8E0RYNBvjWBYYawmu1I1XAjP\nMPuoSpaKH2JCI4wXD/S6ZJwXrEcp352YXtJsYHFcoqzceePnbgBHH7UNKOgCneSa\n/RP0ptl8sfjcXyMmCZGAc9AUG95DqYMl8uacLxXK/qarigd1iwzdUYRr5PjRznei\ngQ==\n-----END CERTIFICATE-----\n\nThawte Server CA\n================\n\n-----BEGIN CERTIFICATE-----\nMIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkEx\nFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD\nVQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv\nbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEm\nMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wHhcNOTYwODAx\nMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT\nDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3\ndGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNl\ncyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3\nDQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD\ngY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl/Kj0R1HahbUgdJSGHg91\nyekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg71CcEJRCX\nL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGj\nEzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG\n7oWDTSEwjsrZqG9JGubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6e\nQNuozDJ0uW8NxuOzRAvZim+aKZuZGCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZ\nqdq5snUb9kLy78fyGPmJvKP/iiMucEc=\n-----END CERTIFICATE-----\n\nThawte Premium Server CA\n========================\n\n-----BEGIN CERTIFICATE-----\nMIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx\nFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD\nVQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv\nbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy\ndmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t\nMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB\nMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG\nA1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp\nb24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl\ncnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv\nbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE\nVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ\nug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR\nuHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG\n9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI\nhfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM\npAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg==\n-----END CERTIFICATE-----\n\nEquifax Secure CA\n=================\n\n-----BEGIN CERTIFICATE-----\nMIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV\nUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy\ndGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1\nMVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx\ndWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B\nAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f\nBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A\ncJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC\nAwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ\nMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm\naWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw\nODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj\nIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF\nMAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA\nA4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y\n7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh\n1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4\n-----END CERTIFICATE-----\n\nVerisign Class 1 Public Primary Certification Authority\n=======================================================\n\n-----BEGIN CERTIFICATE-----\nMIICPTCCAaYCEQDNun9W8N/kvFT+IqyzcqpVMA0GCSqGSIb3DQEBAgUAMF8xCzAJ\nBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh\nc3MgMSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05\nNjAxMjkwMDAwMDBaFw0yODA4MDEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD\nVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMSBQdWJsaWMgUHJp\nbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB\njQAwgYkCgYEA5Rm/baNWYS2ZSHH2Z965jeu3noaACpEO+jglr0aIguVzqKCbJF0N\nH8xlbgyw0FaEGIeaBpsQoXPftFg5a27B9hXVqKg/qhIGjTGsf7A01480Z4gJzRQR\n4k5FVmkfeAKA2txHkSm7NsljXMXg1y2He6G3MrB7MLoqLzGq7qNn2tsCAwEAATAN\nBgkqhkiG9w0BAQIFAAOBgQBMP7iLxmjf7kMzDl3ppssHhE16M/+SG/Q2rdiVIjZo\nEWx8QszznC7EBz8UsA9P/5CSdvnivErpj82ggAr3xSnxgiJduLHdgSOjeyUVRjB5\nFvjqBUuUfx3CHMjjt/QQQDwTw18fU+hI5Ia0e6E1sHslurjTjqs/OJ0ANACY89Fx\nlA==\n-----END CERTIFICATE-----\n\nVerisign Class 2 Public Primary Certification Authority\n=======================================================\n\n-----BEGIN CERTIFICATE-----\nMIICPDCCAaUCEC0b/EoXjaOR6+f/9YtFvgswDQYJKoZIhvcNAQECBQAwXzELMAkG\nA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz\ncyAyIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2\nMDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV\nBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAyIFB1YmxpYyBQcmlt\nYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN\nADCBiQKBgQC2WoujDWojg4BrzzmH9CETMwZMJaLtVRKXxaeAufqDwSCg+i8VDXyh\nYGt+eSz6Bg86rvYbb7HS/y8oUl+DfUvEerf4Zh+AVPy3wo5ZShRXRtGak75BkQO7\nFYCTXOvnzAhsPz6zSvz/S2wj1VCCJkQZjiPDceoZJEcEnnW/yKYAHwIDAQABMA0G\nCSqGSIb3DQEBAgUAA4GBAIobK/o5wXTXXtgZZKJYSi034DNHD6zt96rbHuSLBlxg\nJ8pFUs4W7z8GZOeUaHxgMxURaa+dYo2jA1Rrpr7l7gUYYAS/QoD90KioHgE796Nc\nr6Pc5iaAIzy4RHT3Cq5Ji2F4zCS/iIqnDupzGUH9TQPwiNHleI2lKk/2lw0Xd8rY\n-----END CERTIFICATE-----\n\nVerisign Class 3 Public Primary Certification Authority\n=======================================================\n\n-----BEGIN CERTIFICATE-----\nMIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG\nA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz\ncyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2\nMDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV\nBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt\nYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN\nADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE\nBarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is\nI19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G\nCSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do\nlbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc\nAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k\n-----END CERTIFICATE-----\n\nVerisign Class 1 Public Primary Certification Authority - G2\n============================================================\n\n-----BEGIN CERTIFICATE-----\nMIIDAjCCAmsCEEzH6qqYPnHTkxD4PTqJkZIwDQYJKoZIhvcNAQEFBQAwgcExCzAJ\nBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh\nc3MgMSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy\nMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp\nemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X\nDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw\nFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMg\nUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo\nYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5\nMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB\nAQUAA4GNADCBiQKBgQCq0Lq+Fi24g9TK0g+8djHKlNgdk4xWArzZbxpvUjZudVYK\nVdPfQ4chEWWKfo+9Id5rMj8bhDSVBZ1BNeuS65bdqlk/AVNtmU/t5eIqWpDBucSm\nFc/IReumXY6cPvBkJHalzasab7bYe1FhbqZ/h8jit+U03EGI6glAvnOSPWvndQID\nAQABMA0GCSqGSIb3DQEBBQUAA4GBAKlPww3HZ74sy9mozS11534Vnjty637rXC0J\nh9ZrbWB85a7FkCMMXErQr7Fd88e2CtvgFZMN3QO8x3aKtd1Pw5sTdbgBwObJW2ul\nuIncrKTdcu1OofdPvAbT6shkdHvClUGcZXNY8ZCaPGqxmMnEh7zPRW1F4m4iP/68\nDzFc6PLZ\n-----END CERTIFICATE-----\n\nVerisign Class 2 Public Primary Certification Authority - G2\n============================================================\n\n-----BEGIN CERTIFICATE-----\nMIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQsw\nCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0Ns\nYXNzIDIgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH\nMjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y\naXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazAe\nFw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJVUzEX\nMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGlj\nIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMx\nKGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s\neTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazCBnzANBgkqhkiG9w0B\nAQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjxnNuX6Zr8wgQGE75fUsjM\nHiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRCwiNPStjw\nDqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cC\nAwEAATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9ji\nnb3/7aHmZuovCfTK1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAX\nrXfMSTWqz9iP0b63GJZHc2pUIjRkLbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnIn\njBJ7xUS0rg==\n-----END CERTIFICATE-----\n\nVerisign Class 3 Public Primary Certification Authority - G2\n============================================================\n\n-----BEGIN CERTIFICATE-----\nMIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ\nBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh\nc3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy\nMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp\nemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X\nDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw\nFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg\nUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo\nYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5\nMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB\nAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4\npO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0\n13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID\nAQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk\nU01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i\nF6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY\noJ2daZH9\n-----END CERTIFICATE-----\n\nVerisign Class 4 Public Primary Certification Authority - G2\n============================================================\n\n-----BEGIN CERTIFICATE-----\nMIIDAjCCAmsCEDKIjprS9esTR/h/xCA3JfgwDQYJKoZIhvcNAQEFBQAwgcExCzAJ\nBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh\nc3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy\nMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp\nemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X\nDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw\nFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgNCBQdWJsaWMg\nUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo\nYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5\nMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB\nAQUAA4GNADCBiQKBgQC68OTP+cSuhVS5B1f5j8V/aBH4xBewRNzjMHPVKmIquNDM\nHO0oW369atyzkSTKQWI8/AIBvxwWMZQFl3Zuoq29YRdsTjCG8FE3KlDHqGKB3FtK\nqsGgtG7rL+VXxbErQHDbWk2hjh+9Ax/YA9SPTJlxvOKCzFjomDqG04Y48wApHwID\nAQABMA0GCSqGSIb3DQEBBQUAA4GBAIWMEsGnuVAVess+rLhDityq3RS6iYF+ATwj\ncSGIL4LcY/oCRaxFWdcqWERbt5+BO5JoPeI3JPV7bI92NZYJqFmduc4jq3TWg/0y\ncyfYaT5DdPauxYma51N86Xv2S/PBZYPejYqcPIiNOVn8qj8ijaHBZlCBckztImRP\nT8qAkbYp\n-----END CERTIFICATE-----\n\nVerisign Class 1 Public Primary Certification Authority - G3\n============================================================\n\n-----BEGIN CERTIFICATE-----\nMIIEGjCCAwICEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEBBQUAMIHKMQsw\nCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl\ncmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu\nLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT\naWduIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\ndHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD\nVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT\naWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ\nbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu\nIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg\nLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN2E1Lm0+afY8wR4\nnN493GwTFtl63SRRZsDHJlkNrAYIwpTRMx/wgzUfbhvI3qpuFU5UJ+/EbRrsC+MO\n8ESlV8dAWB6jRx9x7GD2bZTIGDnt/kIYVt/kTEkQeE4BdjVjEjbdZrwBBDajVWjV\nojYJrKshJlQGrT/KFOCsyq0GHZXi+J3x4GD/wn91K0zM2v6HmSHquv4+VNfSWXjb\nPG7PoBMAGrgnoeS+Z5bKoMWznN3JdZ7rMJpfo83ZrngZPyPpXNspva1VyBtUjGP2\n6KbqxzcSXKMpHgLZ2x87tNcPVkeBFQRKr4Mn0cVYiMHd9qqnoxjaaKptEVHhv2Vr\nn5Z20T0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAq2aN17O6x5q25lXQBfGfMY1a\nqtmqRiYPce2lrVNWYgFHKkTp/j90CxObufRNG7LRX7K20ohcs5/Ny9Sn2WCVhDr4\nwTcdYcrnsMXlkdpUpqwxga6X3s0IrLjAl4B/bnKk52kTlWUfxJM8/XmPBNQ+T+r3\nns7NZ3xPZQL/kYVUc8f/NveGLezQXk//EZ9yBta4GvFMDSZl4kSAHsef493oCtrs\npSCAaWihT37ha88HQfqDjrw43bAuEbFrskLMmrz5SCJ5ShkPshw+IHTZasO+8ih4\nE1Z5T21Q6huwtVexN2ZYI/PcD98Kh8TvhgXVOBRgmaNL3gaWcSzy27YfpO8/7g==\n-----END CERTIFICATE-----\n\nVerisign Class 2 Public Primary Certification Authority - G3\n============================================================\n\n-----BEGIN CERTIFICATE-----\nMIIEGTCCAwECEGFwy0mMX5hFKeewptlQW3owDQYJKoZIhvcNAQEFBQAwgcoxCzAJ\nBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVy\naVNpZ24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24s\nIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNp\nZ24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0\neSAtIEczMB4XDTk5MTAwMTAwMDAwMFoXDTM2MDcxNjIzNTk1OVowgcoxCzAJBgNV\nBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNp\nZ24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIElu\nYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24g\nQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt\nIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArwoNwtUs22e5LeWU\nJ92lvuCwTY+zYVY81nzD9M0+hsuiiOLh2KRpxbXiv8GmR1BeRjmL1Za6tW8UvxDO\nJxOeBUebMXoT2B/Z0wI3i60sR/COgQanDTAM6/c8DyAd3HJG7qUCyFvDyVZpTMUY\nwZF7C9UTAJu878NIPkZgIIUq1ZC2zYugzDLdt/1AVbJQHFauzI13TccgTacxdu9o\nkoqQHgiBVrKtaaNS0MscxCM9H5n+TOgWY47GCI72MfbS+uV23bUckqNJzc0BzWjN\nqWm6o+sdDZykIKbBoMXRRkwXbdKsZj+WjOCE1Db/IlnF+RFgqF8EffIa9iVCYQ/E\nSrg+iQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQA0JhU8wI1NQ0kdvekhktdmnLfe\nxbjQ5F1fdiLAJvmEOjr5jLX77GDx6M4EsMjdpwOPMPOY36TmpDHf0xwLRtxyID+u\n7gU8pDM/CzmscHhzS5kr3zDCVLCoO1Wh/hYozUK9dG6A2ydEp85EXdQbkJgNHkKU\nsQAsBNB0owIFImNjzYO1+8FtYmtpdf1dcEG59b98377BMnMiIYtYgXsVkXq642RI\nsH/7NiXaldDxJBQX3RiAa0YjOVT1jmIJBB2UkKab5iXiQkWquJCtvgiPqQtCGJTP\ncjnhsUPgKM+351psE2tJs//jGHyJizNdrDPXp/naOlXJWBD5qu9ats9LS98q\n-----END CERTIFICATE-----\n\nVerisign Class 3 Public Primary Certification Authority - G3\n============================================================\n\n-----BEGIN CERTIFICATE-----\nMIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw\nCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl\ncmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu\nLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT\naWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\ndHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD\nVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT\naWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ\nbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu\nIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg\nLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b\nN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t\nKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu\nkxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm\nCC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ\nXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu\nimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te\n2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe\nDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC\n/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p\nF4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt\nTxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==\n-----END CERTIFICATE-----\n\nVerisign Class 4 Public Primary Certification Authority - G3\n============================================================\n\n-----BEGIN CERTIFICATE-----\nMIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQsw\nCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl\ncmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu\nLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT\naWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\ndHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD\nVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT\naWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ\nbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu\nIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg\nLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK3LpRFpxlmr8Y+1\nGQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaStBO3IFsJ\n+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0Gbd\nU6LM8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLm\nNxdLMEYH5IBtptiWLugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XY\nufTsgsbSPZUd5cBPhMnZo0QoBmrXRazwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/\nky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAj/ola09b5KROJ1WrIhVZPMq1\nCtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXttmhwwjIDLk5Mq\ng6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm\nfjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c\n2NU8Qh0XwRJdRTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/\nbLvSHgCwIe34QWKCudiyxLtGUPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg==\n-----END CERTIFICATE-----\n\nEquifax Secure Global eBusiness CA\n==================================\n\n-----BEGIN CERTIFICATE-----\nMIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEc\nMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBT\nZWN1cmUgR2xvYmFsIGVCdXNpbmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIw\nMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0VxdWlmYXggU2Vj\ndXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEdsb2JhbCBlQnVzaW5l\nc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRVPEnC\nUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc\n58O/gGzNqfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/\no5brhTMhHD4ePmBudpxnhcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAH\nMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUvqigdHJQa0S3ySPY+6j/s1dr\naGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA\nA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA\nZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv\n8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV\n-----END CERTIFICATE-----\n\nEquifax Secure eBusiness CA 1\n=============================\n\n-----BEGIN CERTIFICATE-----\nMIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEc\nMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBT\nZWN1cmUgZUJ1c2luZXNzIENBLTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQw\nMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5j\nLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENBLTEwgZ8wDQYJ\nKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ1MRo\nRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBu\nWqDZQu4aIZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKw\nEnv+j6YDAgMBAAGjZjBkMBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTAD\nAQH/MB8GA1UdIwQYMBaAFEp4MlIR21kWNl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRK\neDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQFAAOBgQB1W6ibAxHm6VZM\nzfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5lSE/9dR+\nWB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN\n/Bf+KpYrtWKmpj29f5JZzVoqgrI3eQ==\n-----END CERTIFICATE-----\n\nEquifax Secure eBusiness CA 2\n=============================\n\n-----BEGIN CERTIFICATE-----\nMIIDIDCCAomgAwIBAgIEN3DPtTANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV\nUzEXMBUGA1UEChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2Vj\ndXJlIGVCdXNpbmVzcyBDQS0yMB4XDTk5MDYyMzEyMTQ0NVoXDTE5MDYyMzEyMTQ0\nNVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkVxdWlmYXggU2VjdXJlMSYwJAYD\nVQQLEx1FcXVpZmF4IFNlY3VyZSBlQnVzaW5lc3MgQ0EtMjCBnzANBgkqhkiG9w0B\nAQEFAAOBjQAwgYkCgYEA5Dk5kx5SBhsoNviyoynF7Y6yEb3+6+e0dMKP/wXn2Z0G\nvxLIPw7y1tEkshHe0XMJitSxLJgJDR5QRrKDpkWNYmi7hRsgcDKqQM2mll/EcTc/\nBPO3QSQ5BxoeLmFYoBIL5aXfxavqN3HMHMg3OrmXUqesxWoklE6ce8/AatbfIb0C\nAwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEX\nMBUGA1UEChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2VjdXJl\nIGVCdXNpbmVzcyBDQS0yMQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTkw\nNjIzMTIxNDQ1WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUUJ4L6q9euSBIplBq\ny/3YIHqngnYwHQYDVR0OBBYEFFCeC+qvXrkgSKZQasv92CB6p4J2MAwGA1UdEwQF\nMAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA\nA4GBAAyGgq3oThr1jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy\n0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1\nE4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUmV+GRMOrN\n-----END CERTIFICATE-----\n\nThawte Time Stamping CA\n=======================\n\n-----BEGIN CERTIFICATE-----\nMIICoTCCAgqgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBizELMAkGA1UEBhMCWkEx\nFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTEUMBIGA1UEBxMLRHVyYmFudmlsbGUxDzAN\nBgNVBAoTBlRoYXd0ZTEdMBsGA1UECxMUVGhhd3RlIENlcnRpZmljYXRpb24xHzAd\nBgNVBAMTFlRoYXd0ZSBUaW1lc3RhbXBpbmcgQ0EwHhcNOTcwMTAxMDAwMDAwWhcN\nMjAxMjMxMjM1OTU5WjCBizELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4g\nQ2FwZTEUMBIGA1UEBxMLRHVyYmFudmlsbGUxDzANBgNVBAoTBlRoYXd0ZTEdMBsG\nA1UECxMUVGhhd3RlIENlcnRpZmljYXRpb24xHzAdBgNVBAMTFlRoYXd0ZSBUaW1l\nc3RhbXBpbmcgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANYrWHhhRYZT\n6jR7UZztsOYuGA7+4F+oJ9O0yeB8WU4WDnNUYMF/9p8u6TqFJBU820cEY8OexJQa\nWt9MevPZQx08EHp5JduQ/vBR5zDWQQD9nyjfeb6Uu522FOMjhdepQeBMpHmwKxqL\n8vg7ij5FrHGSALSQQZj7X+36ty6K+Ig3AgMBAAGjEzARMA8GA1UdEwEB/wQFMAMB\nAf8wDQYJKoZIhvcNAQEEBQADgYEAZ9viwuaHPUCDhjc1fR/OmsMMZiCouqoEiYbC\n9RAIDb/LogWK0E02PvTX72nGXuSwlG9KuefeW4i2e9vjJ+V2w/A1wcu1J5szedyQ\npgCed/r8zSeUQhac0xxo7L9c3eWpexAKMnRUEzGLhQOEkbdYATAUOK8oyvyxUBkZ\nCayJSdM=\n-----END CERTIFICATE-----\n\nthawte Primary Root CA\n======================\n\n-----BEGIN CERTIFICATE-----\nMIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB\nqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf\nQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw\nMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNV\nBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3MDAwMDAwWhcNMzYw\nNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5j\nLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYG\nA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl\nIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqG\nSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsoPD7gFnUnMekz52hWXMJEEUMDSxuaPFs\nW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ1CRfBsDMRJSUjQJib+ta\n3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGcq/gcfomk\n6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6\nSk/KaAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94J\nNqR32HuHUETVPm4pafs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBA\nMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XP\nr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7ORtvzw6WfU\nDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz\nYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX\nxPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2\n/qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/\nLHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7\njVaMaA==\n-----END CERTIFICATE-----\n\nVeriSign Class 3 Public Primary Certification Authority - G5\n============================================================\n\n-----BEGIN CERTIFICATE-----\nMIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB\nyjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL\nExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp\nU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW\nZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0\naG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL\nMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW\nZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln\nbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp\nU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y\naXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1\nnmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex\nt0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz\nSdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG\nBO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+\nrCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/\nNIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E\nBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH\nBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy\naXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv\nMzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE\np6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y\n5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK\nWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ\n4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N\nhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq\n-----END CERTIFICATE-----\n\nEntrust.net Secure Server Certification Authority\n=================================================\n\n-----BEGIN CERTIFICATE-----\nMIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\nVVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\nZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\nKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\nZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1\nMjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE\nChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j\nb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF\nbnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg\nU2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA\nA4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/\nI0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3\nwkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC\nAdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb\noIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5\nBgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p\ndHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk\nMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp\nb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu\ndHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0\nMFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi\nE1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa\nMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI\nhvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN\n95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd\n2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=\n-----END CERTIFICATE-----\n\nGo Daddy Certification Authority Root Certificate Bundle\n========================================================\n\n-----BEGIN CERTIFICATE-----\nMIIE3jCCA8agAwIBAgICAwEwDQYJKoZIhvcNAQEFBQAwYzELMAkGA1UEBhMCVVMx\nITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g\nRGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMTYw\nMTU0MzdaFw0yNjExMTYwMTU0MzdaMIHKMQswCQYDVQQGEwJVUzEQMA4GA1UECBMH\nQXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEaMBgGA1UEChMRR29EYWRkeS5j\nb20sIEluYy4xMzAxBgNVBAsTKmh0dHA6Ly9jZXJ0aWZpY2F0ZXMuZ29kYWRkeS5j\nb20vcmVwb3NpdG9yeTEwMC4GA1UEAxMnR28gRGFkZHkgU2VjdXJlIENlcnRpZmlj\nYXRpb24gQXV0aG9yaXR5MREwDwYDVQQFEwgwNzk2OTI4NzCCASIwDQYJKoZIhvcN\nAQEBBQADggEPADCCAQoCggEBAMQt1RWMnCZM7DI161+4WQFapmGBWTtwY6vj3D3H\nKrjJM9N55DrtPDAjhI6zMBS2sofDPZVUBJ7fmd0LJR4h3mUpfjWoqVTr9vcyOdQm\nVZWt7/v+WIbXnvQAjYwqDL1CBM6nPwT27oDyqu9SoWlm2r4arV3aLGbqGmu75RpR\nSgAvSMeYddi5Kcju+GZtCpyz8/x4fKL4o/K1w/O5epHBp+YlLpyo7RJlbmr2EkRT\ncDCVw5wrWCs9CHRK8r5RsL+H0EwnWGu1NcWdrxcx+AuP7q2BNgWJCJjPOq8lh8BJ\n6qf9Z/dFjpfMFDniNoW1fho3/Rb2cRGadDAW/hOUoz+EDU8CAwEAAaOCATIwggEu\nMB0GA1UdDgQWBBT9rGEyk2xF1uLuhV+auud2mWjM5zAfBgNVHSMEGDAWgBTSxLDS\nkdRMEXGzYcs9of7dqGrU4zASBgNVHRMBAf8ECDAGAQH/AgEAMDMGCCsGAQUFBwEB\nBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZ29kYWRkeS5jb20wRgYDVR0f\nBD8wPTA7oDmgN4Y1aHR0cDovL2NlcnRpZmljYXRlcy5nb2RhZGR5LmNvbS9yZXBv\nc2l0b3J5L2dkcm9vdC5jcmwwSwYDVR0gBEQwQjBABgRVHSAAMDgwNgYIKwYBBQUH\nAgEWKmh0dHA6Ly9jZXJ0aWZpY2F0ZXMuZ29kYWRkeS5jb20vcmVwb3NpdG9yeTAO\nBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQEFBQADggEBANKGwOy9+aG2Z+5mC6IG\nOgRQjhVyrEp0lVPLN8tESe8HkGsz2ZbwlFalEzAFPIUyIXvJxwqoJKSQ3kbTJSMU\nA2fCENZvD117esyfxVgqwcSeIaha86ykRvOe5GPLL5CkKSkB2XIsKd83ASe8T+5o\n0yGPwLPk9Qnt0hCqU7S+8MxZC9Y7lhyVJEnfzuz9p0iRFEUOOjZv2kWzRaJBydTX\nRE4+uXR21aITVSzGh6O1mawGhId/dQb8vxRMDsxuxN89txJx9OjxUUAiKEngHUuH\nqDTMBqLdElrRhjZkAzVvb3du6/KFUJheqwNTrZEjYx8WnM25sgVjOuH0aBsXBTWV\nU+4=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIE+zCCBGSgAwIBAgICAQ0wDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1Zh\nbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIElu\nYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24g\nQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAe\nBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTA0MDYyOTE3MDYyMFoX\nDTI0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBE\nYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3MgMiBDZXJ0\naWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgC\nggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv\n2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+q\nN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiO\nr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lN\nf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+YihfukEH\nU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjggHhMIIB3TAdBgNVHQ4EFgQU0sSw0pHU\nTBFxs2HLPaH+3ahq1OMwgdIGA1UdIwSByjCBx6GBwaSBvjCBuzEkMCIGA1UEBxMb\nVmFsaUNlcnQgVmFsaWRhdGlvbiBOZXR3b3JrMRcwFQYDVQQKEw5WYWxpQ2VydCwg\nSW5jLjE1MDMGA1UECxMsVmFsaUNlcnQgQ2xhc3MgMiBQb2xpY3kgVmFsaWRhdGlv\nbiBBdXRob3JpdHkxITAfBgNVBAMTGGh0dHA6Ly93d3cudmFsaWNlcnQuY29tLzEg\nMB4GCSqGSIb3DQEJARYRaW5mb0B2YWxpY2VydC5jb22CAQEwDwYDVR0TAQH/BAUw\nAwEB/zAzBggrBgEFBQcBAQQnMCUwIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmdv\nZGFkZHkuY29tMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jZXJ0aWZpY2F0ZXMu\nZ29kYWRkeS5jb20vcmVwb3NpdG9yeS9yb290LmNybDBLBgNVHSAERDBCMEAGBFUd\nIAAwODA2BggrBgEFBQcCARYqaHR0cDovL2NlcnRpZmljYXRlcy5nb2RhZGR5LmNv\nbS9yZXBvc2l0b3J5MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOBgQC1\nQPmnHfbq/qQaQlpE9xXUhUaJwL6e4+PrxeNYiY+Sn1eocSxI0YGyeR+sBjUZsE4O\nWBsUs5iB0QQeyAfJg594RAoYC5jcdnplDQ1tgMQLARzLrUc+cb53S8wGd9D0Vmsf\nSxOaFIqII6hR8INMqzW/Rn453HWkrugp++85j09VZw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0\nIFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz\nBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y\naXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG\n9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE5MDYy\nNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y\nazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs\nYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw\nOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl\ncnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5avIWZJV16vY\ndA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zfN1SLUzm1NZ9\nWlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7RfZHM047QS\nv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9v\nUJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTu\nIYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwC\nW/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd\n-----END CERTIFICATE-----\n\n"
  },
  {
    "path": "lib/httplib2/iri2uri.py",
    "content": "\"\"\"\niri2uri\n\nConverts an IRI to a URI.\n\n\"\"\"\n__author__ = \"Joe Gregorio (joe@bitworking.org)\"\n__copyright__ = \"Copyright 2006, Joe Gregorio\"\n__contributors__ = []\n__version__ = \"1.0.0\"\n__license__ = \"MIT\"\n__history__ = \"\"\"\n\"\"\"\n\nimport urlparse\n\n\n# Convert an IRI to a URI following the rules in RFC 3987\n# \n# The characters we need to enocde and escape are defined in the spec:\n#\n# iprivate =  %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD\n# ucschar = %xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF\n#         / %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD\n#         / %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD\n#         / %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD\n#         / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD\n#         / %xD0000-DFFFD / %xE1000-EFFFD\n\nescape_range = [\n   (0xA0, 0xD7FF ),\n   (0xE000, 0xF8FF ),\n   (0xF900, 0xFDCF ),\n   (0xFDF0, 0xFFEF),\n   (0x10000, 0x1FFFD ),\n   (0x20000, 0x2FFFD ),\n   (0x30000, 0x3FFFD),\n   (0x40000, 0x4FFFD ),\n   (0x50000, 0x5FFFD ),\n   (0x60000, 0x6FFFD),\n   (0x70000, 0x7FFFD ),\n   (0x80000, 0x8FFFD ),\n   (0x90000, 0x9FFFD),\n   (0xA0000, 0xAFFFD ),\n   (0xB0000, 0xBFFFD ),\n   (0xC0000, 0xCFFFD),\n   (0xD0000, 0xDFFFD ),\n   (0xE1000, 0xEFFFD),\n   (0xF0000, 0xFFFFD ),\n   (0x100000, 0x10FFFD)\n]\n \ndef encode(c):\n    retval = c\n    i = ord(c)\n    for low, high in escape_range:\n        if i < low:\n            break\n        if i >= low and i <= high:\n            retval = \"\".join([\"%%%2X\" % ord(o) for o in c.encode('utf-8')])\n            break\n    return retval\n\n\ndef iri2uri(uri):\n    \"\"\"Convert an IRI to a URI. Note that IRIs must be \n    passed in a unicode strings. That is, do not utf-8 encode\n    the IRI before passing it into the function.\"\"\" \n    if isinstance(uri ,unicode):\n        (scheme, authority, path, query, fragment) = urlparse.urlsplit(uri)\n        authority = authority.encode('idna')\n        # For each character in 'ucschar' or 'iprivate'\n        #  1. encode as utf-8\n        #  2. then %-encode each octet of that utf-8 \n        uri = urlparse.urlunsplit((scheme, authority, path, query, fragment))\n        uri = \"\".join([encode(c) for c in uri])\n    return uri\n        \nif __name__ == \"__main__\":\n    import unittest\n\n    class Test(unittest.TestCase):\n\n        def test_uris(self):\n            \"\"\"Test that URIs are invariant under the transformation.\"\"\"\n            invariant = [ \n                u\"ftp://ftp.is.co.za/rfc/rfc1808.txt\",\n                u\"http://www.ietf.org/rfc/rfc2396.txt\",\n                u\"ldap://[2001:db8::7]/c=GB?objectClass?one\",\n                u\"mailto:John.Doe@example.com\",\n                u\"news:comp.infosystems.www.servers.unix\",\n                u\"tel:+1-816-555-1212\",\n                u\"telnet://192.0.2.16:80/\",\n                u\"urn:oasis:names:specification:docbook:dtd:xml:4.1.2\" ]\n            for uri in invariant:\n                self.assertEqual(uri, iri2uri(uri))\n            \n        def test_iri(self):\n            \"\"\" Test that the right type of escaping is done for each part of the URI.\"\"\"\n            self.assertEqual(\"http://xn--o3h.com/%E2%98%84\", iri2uri(u\"http://\\u2604.com/\\u2604\"))\n            self.assertEqual(\"http://bitworking.org/?fred=%E2%98%84\", iri2uri(u\"http://bitworking.org/?fred=\\u2604\"))\n            self.assertEqual(\"http://bitworking.org/#%E2%98%84\", iri2uri(u\"http://bitworking.org/#\\u2604\"))\n            self.assertEqual(\"#%E2%98%84\", iri2uri(u\"#\\u2604\"))\n            self.assertEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(u\"/fred?bar=\\u261B#\\u2604\"))\n            self.assertEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(iri2uri(u\"/fred?bar=\\u261B#\\u2604\")))\n            self.assertNotEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(u\"/fred?bar=\\u261B#\\u2604\".encode('utf-8')))\n\n    unittest.main()\n\n    \n"
  },
  {
    "path": "lib/httplib2/socks.py",
    "content": "\"\"\"SocksiPy - Python SOCKS module.\nVersion 1.00\n\nCopyright 2006 Dan-Haim. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n3. Neither the name of Dan Haim nor the names of his contributors may be used\n   to endorse or promote products derived from this software without specific\n   prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY DAN HAIM \"AS IS\" AND ANY EXPRESS OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\nEVENT SHALL DAN HAIM OR HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA\nOR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\nOF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMANGE.\n\n\nThis module provides a standard socket-like interface for Python\nfor tunneling connections through SOCKS proxies.\n\n\"\"\"\n\n\"\"\"\n\nMinor modifications made by Christopher Gilbert (http://motomastyle.com/)\nfor use in PyLoris (http://pyloris.sourceforge.net/)\n\nMinor modifications made by Mario Vilas (http://breakingcode.wordpress.com/)\nmainly to merge bug fixes found in Sourceforge\n\n\"\"\"\n\nimport base64\nimport socket\nimport struct\nimport sys\n\nif getattr(socket, 'socket', None) is None:\n    raise ImportError('socket.socket missing, proxy support unusable')\n\nPROXY_TYPE_SOCKS4 = 1\nPROXY_TYPE_SOCKS5 = 2\nPROXY_TYPE_HTTP = 3\nPROXY_TYPE_HTTP_NO_TUNNEL = 4\n\n_defaultproxy = None\n_orgsocket = socket.socket\n\nclass ProxyError(Exception): pass\nclass GeneralProxyError(ProxyError): pass\nclass Socks5AuthError(ProxyError): pass\nclass Socks5Error(ProxyError): pass\nclass Socks4Error(ProxyError): pass\nclass HTTPError(ProxyError): pass\n\n_generalerrors = (\"success\",\n    \"invalid data\",\n    \"not connected\",\n    \"not available\",\n    \"bad proxy type\",\n    \"bad input\")\n\n_socks5errors = (\"succeeded\",\n    \"general SOCKS server failure\",\n    \"connection not allowed by ruleset\",\n    \"Network unreachable\",\n    \"Host unreachable\",\n    \"Connection refused\",\n    \"TTL expired\",\n    \"Command not supported\",\n    \"Address type not supported\",\n    \"Unknown error\")\n\n_socks5autherrors = (\"succeeded\",\n    \"authentication is required\",\n    \"all offered authentication methods were rejected\",\n    \"unknown username or invalid password\",\n    \"unknown error\")\n\n_socks4errors = (\"request granted\",\n    \"request rejected or failed\",\n    \"request rejected because SOCKS server cannot connect to identd on the client\",\n    \"request rejected because the client program and identd report different user-ids\",\n    \"unknown error\")\n\ndef setdefaultproxy(proxytype=None, addr=None, port=None, rdns=True, username=None, password=None):\n    \"\"\"setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]])\n    Sets a default proxy which all further socksocket objects will use,\n    unless explicitly changed.\n    \"\"\"\n    global _defaultproxy\n    _defaultproxy = (proxytype, addr, port, rdns, username, password)\n\ndef wrapmodule(module):\n    \"\"\"wrapmodule(module)\n    Attempts to replace a module's socket library with a SOCKS socket. Must set\n    a default proxy using setdefaultproxy(...) first.\n    This will only work on modules that import socket directly into the namespace;\n    most of the Python Standard Library falls into this category.\n    \"\"\"\n    if _defaultproxy != None:\n        module.socket.socket = socksocket\n    else:\n        raise GeneralProxyError((4, \"no proxy specified\"))\n\nclass socksocket(socket.socket):\n    \"\"\"socksocket([family[, type[, proto]]]) -> socket object\n    Open a SOCKS enabled socket. The parameters are the same as\n    those of the standard socket init. In order for SOCKS to work,\n    you must specify family=AF_INET, type=SOCK_STREAM and proto=0.\n    \"\"\"\n\n    def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None):\n        _orgsocket.__init__(self, family, type, proto, _sock)\n        if _defaultproxy != None:\n            self.__proxy = _defaultproxy\n        else:\n            self.__proxy = (None, None, None, None, None, None)\n        self.__proxysockname = None\n        self.__proxypeername = None\n        self.__httptunnel = True\n\n    def __recvall(self, count):\n        \"\"\"__recvall(count) -> data\n        Receive EXACTLY the number of bytes requested from the socket.\n        Blocks until the required number of bytes have been received.\n        \"\"\"\n        data = self.recv(count)\n        while len(data) < count:\n            d = self.recv(count-len(data))\n            if not d: raise GeneralProxyError((0, \"connection closed unexpectedly\"))\n            data = data + d\n        return data\n\n    def sendall(self, content, *args):\n        \"\"\" override socket.socket.sendall method to rewrite the header\n        for non-tunneling proxies if needed\n        \"\"\"\n        if not self.__httptunnel:\n            content = self.__rewriteproxy(content)\n        return super(socksocket, self).sendall(content, *args)\n\n    def __rewriteproxy(self, header):\n        \"\"\" rewrite HTTP request headers to support non-tunneling proxies\n        (i.e. those which do not support the CONNECT method).\n        This only works for HTTP (not HTTPS) since HTTPS requires tunneling.\n        \"\"\"\n        host, endpt = None, None\n        hdrs = header.split(\"\\r\\n\")\n        for hdr in hdrs:\n            if hdr.lower().startswith(\"host:\"):\n                host = hdr\n            elif hdr.lower().startswith(\"get\") or hdr.lower().startswith(\"post\"):\n                endpt = hdr\n        if host and endpt:\n            hdrs.remove(host)\n            hdrs.remove(endpt)\n            host = host.split(\" \")[1]\n            endpt = endpt.split(\" \")\n            if (self.__proxy[4] != None and self.__proxy[5] != None):\n                hdrs.insert(0, self.__getauthheader())\n            hdrs.insert(0, \"Host: %s\" % host)\n            hdrs.insert(0, \"%s http://%s%s %s\" % (endpt[0], host, endpt[1], endpt[2]))\n        return \"\\r\\n\".join(hdrs)\n\n    def __getauthheader(self):\n        auth = self.__proxy[4] + \":\" + self.__proxy[5]\n        return \"Proxy-Authorization: Basic \" + base64.b64encode(auth)\n\n    def setproxy(self, proxytype=None, addr=None, port=None, rdns=True, username=None, password=None):\n        \"\"\"setproxy(proxytype, addr[, port[, rdns[, username[, password]]]])\n        Sets the proxy to be used.\n        proxytype -    The type of the proxy to be used. Three types\n                are supported: PROXY_TYPE_SOCKS4 (including socks4a),\n                PROXY_TYPE_SOCKS5 and PROXY_TYPE_HTTP\n        addr -        The address of the server (IP or DNS).\n        port -        The port of the server. Defaults to 1080 for SOCKS\n                servers and 8080 for HTTP proxy servers.\n        rdns -        Should DNS queries be preformed on the remote side\n                (rather than the local side). The default is True.\n                Note: This has no effect with SOCKS4 servers.\n        username -    Username to authenticate with to the server.\n                The default is no authentication.\n        password -    Password to authenticate with to the server.\n                Only relevant when username is also provided.\n        \"\"\"\n        self.__proxy = (proxytype, addr, port, rdns, username, password)\n\n    def __negotiatesocks5(self, destaddr, destport):\n        \"\"\"__negotiatesocks5(self,destaddr,destport)\n        Negotiates a connection through a SOCKS5 server.\n        \"\"\"\n        # First we'll send the authentication packages we support.\n        if (self.__proxy[4]!=None) and (self.__proxy[5]!=None):\n            # The username/password details were supplied to the\n            # setproxy method so we support the USERNAME/PASSWORD\n            # authentication (in addition to the standard none).\n            self.sendall(struct.pack('BBBB', 0x05, 0x02, 0x00, 0x02))\n        else:\n            # No username/password were entered, therefore we\n            # only support connections with no authentication.\n            self.sendall(struct.pack('BBB', 0x05, 0x01, 0x00))\n        # We'll receive the server's response to determine which\n        # method was selected\n        chosenauth = self.__recvall(2)\n        if chosenauth[0:1] != chr(0x05).encode():\n            self.close()\n            raise GeneralProxyError((1, _generalerrors[1]))\n        # Check the chosen authentication method\n        if chosenauth[1:2] == chr(0x00).encode():\n            # No authentication is required\n            pass\n        elif chosenauth[1:2] == chr(0x02).encode():\n            # Okay, we need to perform a basic username/password\n            # authentication.\n            self.sendall(chr(0x01).encode() + chr(len(self.__proxy[4])) + self.__proxy[4] + chr(len(self.__proxy[5])) + self.__proxy[5])\n            authstat = self.__recvall(2)\n            if authstat[0:1] != chr(0x01).encode():\n                # Bad response\n                self.close()\n                raise GeneralProxyError((1, _generalerrors[1]))\n            if authstat[1:2] != chr(0x00).encode():\n                # Authentication failed\n                self.close()\n                raise Socks5AuthError((3, _socks5autherrors[3]))\n            # Authentication succeeded\n        else:\n            # Reaching here is always bad\n            self.close()\n            if chosenauth[1] == chr(0xFF).encode():\n                raise Socks5AuthError((2, _socks5autherrors[2]))\n            else:\n                raise GeneralProxyError((1, _generalerrors[1]))\n        # Now we can request the actual connection\n        req = struct.pack('BBB', 0x05, 0x01, 0x00)\n        # If the given destination address is an IP address, we'll\n        # use the IPv4 address request even if remote resolving was specified.\n        try:\n            ipaddr = socket.inet_aton(destaddr)\n            req = req + chr(0x01).encode() + ipaddr\n        except socket.error:\n            # Well it's not an IP number,  so it's probably a DNS name.\n            if self.__proxy[3]:\n                # Resolve remotely\n                ipaddr = None\n                req = req + chr(0x03).encode() + chr(len(destaddr)).encode() + destaddr\n            else:\n                # Resolve locally\n                ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))\n                req = req + chr(0x01).encode() + ipaddr\n        req = req + struct.pack(\">H\", destport)\n        self.sendall(req)\n        # Get the response\n        resp = self.__recvall(4)\n        if resp[0:1] != chr(0x05).encode():\n            self.close()\n            raise GeneralProxyError((1, _generalerrors[1]))\n        elif resp[1:2] != chr(0x00).encode():\n            # Connection failed\n            self.close()\n            if ord(resp[1:2])<=8:\n                raise Socks5Error((ord(resp[1:2]), _socks5errors[ord(resp[1:2])]))\n            else:\n                raise Socks5Error((9, _socks5errors[9]))\n        # Get the bound address/port\n        elif resp[3:4] == chr(0x01).encode():\n            boundaddr = self.__recvall(4)\n        elif resp[3:4] == chr(0x03).encode():\n            resp = resp + self.recv(1)\n            boundaddr = self.__recvall(ord(resp[4:5]))\n        else:\n            self.close()\n            raise GeneralProxyError((1,_generalerrors[1]))\n        boundport = struct.unpack(\">H\", self.__recvall(2))[0]\n        self.__proxysockname = (boundaddr, boundport)\n        if ipaddr != None:\n            self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)\n        else:\n            self.__proxypeername = (destaddr, destport)\n\n    def getproxysockname(self):\n        \"\"\"getsockname() -> address info\n        Returns the bound IP address and port number at the proxy.\n        \"\"\"\n        return self.__proxysockname\n\n    def getproxypeername(self):\n        \"\"\"getproxypeername() -> address info\n        Returns the IP and port number of the proxy.\n        \"\"\"\n        return _orgsocket.getpeername(self)\n\n    def getpeername(self):\n        \"\"\"getpeername() -> address info\n        Returns the IP address and port number of the destination\n        machine (note: getproxypeername returns the proxy)\n        \"\"\"\n        return self.__proxypeername\n\n    def __negotiatesocks4(self,destaddr,destport):\n        \"\"\"__negotiatesocks4(self,destaddr,destport)\n        Negotiates a connection through a SOCKS4 server.\n        \"\"\"\n        # Check if the destination address provided is an IP address\n        rmtrslv = False\n        try:\n            ipaddr = socket.inet_aton(destaddr)\n        except socket.error:\n            # It's a DNS name. Check where it should be resolved.\n            if self.__proxy[3]:\n                ipaddr = struct.pack(\"BBBB\", 0x00, 0x00, 0x00, 0x01)\n                rmtrslv = True\n            else:\n                ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))\n        # Construct the request packet\n        req = struct.pack(\">BBH\", 0x04, 0x01, destport) + ipaddr\n        # The username parameter is considered userid for SOCKS4\n        if self.__proxy[4] != None:\n            req = req + self.__proxy[4]\n        req = req + chr(0x00).encode()\n        # DNS name if remote resolving is required\n        # NOTE: This is actually an extension to the SOCKS4 protocol\n        # called SOCKS4A and may not be supported in all cases.\n        if rmtrslv:\n            req = req + destaddr + chr(0x00).encode()\n        self.sendall(req)\n        # Get the response from the server\n        resp = self.__recvall(8)\n        if resp[0:1] != chr(0x00).encode():\n            # Bad data\n            self.close()\n            raise GeneralProxyError((1,_generalerrors[1]))\n        if resp[1:2] != chr(0x5A).encode():\n            # Server returned an error\n            self.close()\n            if ord(resp[1:2]) in (91, 92, 93):\n                self.close()\n                raise Socks4Error((ord(resp[1:2]), _socks4errors[ord(resp[1:2]) - 90]))\n            else:\n                raise Socks4Error((94, _socks4errors[4]))\n        # Get the bound address/port\n        self.__proxysockname = (socket.inet_ntoa(resp[4:]), struct.unpack(\">H\", resp[2:4])[0])\n        if rmtrslv != None:\n            self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)\n        else:\n            self.__proxypeername = (destaddr, destport)\n\n    def __negotiatehttp(self, destaddr, destport):\n        \"\"\"__negotiatehttp(self,destaddr,destport)\n        Negotiates a connection through an HTTP server.\n        \"\"\"\n        # If we need to resolve locally, we do this now\n        if not self.__proxy[3]:\n            addr = socket.gethostbyname(destaddr)\n        else:\n            addr = destaddr\n        headers =  [\"CONNECT \", addr, \":\", str(destport), \" HTTP/1.1\\r\\n\"]\n        headers += [\"Host: \", destaddr, \"\\r\\n\"]\n        if (self.__proxy[4] != None and self.__proxy[5] != None):\n                headers += [self.__getauthheader(), \"\\r\\n\"]\n        headers.append(\"\\r\\n\")\n        self.sendall(\"\".join(headers).encode())\n        # We read the response until we get the string \"\\r\\n\\r\\n\"\n        resp = self.recv(1)\n        while resp.find(\"\\r\\n\\r\\n\".encode()) == -1:\n            resp = resp + self.recv(1)\n        # We just need the first line to check if the connection\n        # was successful\n        statusline = resp.splitlines()[0].split(\" \".encode(), 2)\n        if statusline[0] not in (\"HTTP/1.0\".encode(), \"HTTP/1.1\".encode()):\n            self.close()\n            raise GeneralProxyError((1, _generalerrors[1]))\n        try:\n            statuscode = int(statusline[1])\n        except ValueError:\n            self.close()\n            raise GeneralProxyError((1, _generalerrors[1]))\n        if statuscode != 200:\n            self.close()\n            raise HTTPError((statuscode, statusline[2]))\n        self.__proxysockname = (\"0.0.0.0\", 0)\n        self.__proxypeername = (addr, destport)\n\n    def connect(self, destpair):\n        \"\"\"connect(self, despair)\n        Connects to the specified destination through a proxy.\n        destpar - A tuple of the IP/DNS address and the port number.\n        (identical to socket's connect).\n        To select the proxy server use setproxy().\n        \"\"\"\n        # Do a minimal input check first\n        if (not type(destpair) in (list,tuple)) or (len(destpair) < 2) or (not isinstance(destpair[0], basestring)) or (type(destpair[1]) != int):\n            raise GeneralProxyError((5, _generalerrors[5]))\n        if self.__proxy[0] == PROXY_TYPE_SOCKS5:\n            if self.__proxy[2] != None:\n                portnum = self.__proxy[2]\n            else:\n                portnum = 1080\n            _orgsocket.connect(self, (self.__proxy[1], portnum))\n            self.__negotiatesocks5(destpair[0], destpair[1])\n        elif self.__proxy[0] == PROXY_TYPE_SOCKS4:\n            if self.__proxy[2] != None:\n                portnum = self.__proxy[2]\n            else:\n                portnum = 1080\n            _orgsocket.connect(self,(self.__proxy[1], portnum))\n            self.__negotiatesocks4(destpair[0], destpair[1])\n        elif self.__proxy[0] == PROXY_TYPE_HTTP:\n            if self.__proxy[2] != None:\n                portnum = self.__proxy[2]\n            else:\n                portnum = 8080\n            _orgsocket.connect(self,(self.__proxy[1], portnum))\n            self.__negotiatehttp(destpair[0], destpair[1])\n        elif self.__proxy[0] == PROXY_TYPE_HTTP_NO_TUNNEL:\n            if self.__proxy[2] != None:\n                portnum = self.__proxy[2]\n            else:\n                portnum = 8080\n            _orgsocket.connect(self,(self.__proxy[1],portnum))\n            if destpair[1] == 443:\n                self.__negotiatehttp(destpair[0],destpair[1])\n            else:\n                self.__httptunnel = False\n        elif self.__proxy[0] == None:\n            _orgsocket.connect(self, (destpair[0], destpair[1]))\n        else:\n            raise GeneralProxyError((4, _generalerrors[4]))\n"
  },
  {
    "path": "lib/markdown2.py",
    "content": "#!/usr/bin/env python\n# Copyright (c) 2012 Trent Mick.\n# Copyright (c) 2007-2008 ActiveState Corp.\n# License: MIT (http://www.opensource.org/licenses/mit-license.php)\n\nfrom __future__ import generators\n\nr\"\"\"A fast and complete Python implementation of Markdown.\n\n[from http://daringfireball.net/projects/markdown/]\n> Markdown is a text-to-HTML filter; it translates an easy-to-read /\n> easy-to-write structured text format into HTML.  Markdown's text\n> format is most similar to that of plain text email, and supports\n> features such as headers, *emphasis*, code blocks, blockquotes, and\n> links.\n>\n> Markdown's syntax is designed not as a generic markup language, but\n> specifically to serve as a front-end to (X)HTML. You can use span-level\n> HTML tags anywhere in a Markdown document, and you can use block level\n> HTML tags (like <div> and <table> as well).\n\nModule usage:\n\n    >>> import markdown2\n    >>> markdown2.markdown(\"*boo!*\")  # or use `html = markdown_path(PATH)`\n    u'<p><em>boo!</em></p>\\n'\n\n    >>> markdowner = Markdown()\n    >>> markdowner.convert(\"*boo!*\")\n    u'<p><em>boo!</em></p>\\n'\n    >>> markdowner.convert(\"**boom!**\")\n    u'<p><strong>boom!</strong></p>\\n'\n\nThis implementation of Markdown implements the full \"core\" syntax plus a\nnumber of extras (e.g., code syntax coloring, footnotes) as described on\n<https://github.com/trentm/python-markdown2/wiki/Extras>.\n\"\"\"\n\ncmdln_desc = \"\"\"A fast and complete Python implementation of Markdown, a\ntext-to-HTML conversion tool for web writers.\n\nSupported extra syntax options (see -x|--extras option below and\nsee <https://github.com/trentm/python-markdown2/wiki/Extras> for details):\n\n* code-friendly: Disable _ and __ for em and strong.\n* cuddled-lists: Allow lists to be cuddled to the preceding paragraph.\n* fenced-code-blocks: Allows a code block to not have to be indented\n  by fencing it with '```' on a line before and after. Based on\n  <http://github.github.com/github-flavored-markdown/> with support for\n  syntax highlighting.\n* footnotes: Support footnotes as in use on daringfireball.net and\n  implemented in other Markdown processors (tho not in Markdown.pl v1.0.1).\n* header-ids: Adds \"id\" attributes to headers. The id value is a slug of\n  the header text.\n* html-classes: Takes a dict mapping html tag names (lowercase) to a\n  string to use for a \"class\" tag attribute. Currently only supports\n  \"pre\" and \"code\" tags. Add an issue if you require this for other tags.\n* markdown-in-html: Allow the use of `markdown=\"1\"` in a block HTML tag to\n  have markdown processing be done on its contents. Similar to\n  <http://michelf.com/projects/php-markdown/extra/#markdown-attr> but with\n  some limitations.\n* metadata: Extract metadata from a leading '---'-fenced block.\n  See <https://github.com/trentm/python-markdown2/issues/77> for details.\n* pyshell: Treats unindented Python interactive shell sessions as <code>\n  blocks.\n* link-patterns: Auto-link given regex patterns in text (e.g. bug number\n  references, revision number references).\n* smarty-pants: Replaces ' and \" with curly quotation marks or curly\n  apostrophes.  Replaces --, ---, ..., and . . . with en dashes, em dashes,\n  and ellipses.\n* toc: The returned HTML string gets a new \"toc_html\" attribute which is\n  a Table of Contents for the document. (experimental)\n* xml: Passes one-liner processing instructions and namespaced XML tags.\n* wiki-tables: Google Code Wiki-style tables. See\n  <http://code.google.com/p/support/wiki/WikiSyntax#Tables>.\n\"\"\"\n\n# Dev Notes:\n# - Python's regex syntax doesn't have '\\z', so I'm using '\\Z'. I'm\n#   not yet sure if there implications with this. Compare 'pydoc sre'\n#   and 'perldoc perlre'.\n\n__version_info__ = (2, 0, 2)\n__version__ = '.'.join(map(str, __version_info__))\n__author__ = \"Trent Mick\"\n\nimport os\nimport sys\nfrom pprint import pprint\nimport re\nimport logging\ntry:\n    from hashlib import md5\nexcept ImportError:\n    from md5 import md5\nimport optparse\nfrom random import random, randint\nimport codecs\n\n\n#---- Python version compat\n\ntry:\n    from urllib.parse import quote # python3\nexcept ImportError:\n    from urllib import quote # python2\n\nif sys.version_info[:2] < (2,4):\n    from sets import Set as set\n    def reversed(sequence):\n        for i in sequence[::-1]:\n            yield i\n\n# Use `bytes` for byte strings and `unicode` for unicode strings (str in Py3).\nif sys.version_info[0] <= 2:\n    py3 = False\n    try:\n        bytes\n    except NameError:\n        bytes = str\n    base_string_type = basestring\nelif sys.version_info[0] >= 3:\n    py3 = True\n    unicode = str\n    base_string_type = str\n\n\n\n#---- globals\n\nDEBUG = False\nlog = logging.getLogger(\"markdown\")\n\nDEFAULT_TAB_WIDTH = 4\n\n\nSECRET_SALT = bytes(randint(0, 1000000))\ndef _hash_text(s):\n    return 'md5-' + md5(SECRET_SALT + s.encode(\"utf-8\")).hexdigest()\n\n# Table of hash values for escaped characters:\ng_escape_table = dict([(ch, _hash_text(ch))\n    for ch in '\\\\`*_{}[]()>#+-.!'])\n\n\n\n#---- exceptions\n\nclass MarkdownError(Exception):\n    pass\n\n\n\n#---- public api\n\ndef markdown_path(path, encoding=\"utf-8\",\n                  html4tags=False, tab_width=DEFAULT_TAB_WIDTH,\n                  safe_mode=None, extras=None, link_patterns=None,\n                  use_file_vars=False):\n    fp = codecs.open(path, 'r', encoding)\n    text = fp.read()\n    fp.close()\n    return Markdown(html4tags=html4tags, tab_width=tab_width,\n                    safe_mode=safe_mode, extras=extras,\n                    link_patterns=link_patterns,\n                    use_file_vars=use_file_vars).convert(text)\n\ndef markdown(text, html4tags=False, tab_width=DEFAULT_TAB_WIDTH,\n             safe_mode=None, extras=None, link_patterns=None,\n             use_file_vars=False):\n    return Markdown(html4tags=html4tags, tab_width=tab_width,\n                    safe_mode=safe_mode, extras=extras,\n                    link_patterns=link_patterns,\n                    use_file_vars=use_file_vars).convert(text)\n\nclass Markdown(object):\n    # The dict of \"extras\" to enable in processing -- a mapping of\n    # extra name to argument for the extra. Most extras do not have an\n    # argument, in which case the value is None.\n    #\n    # This can be set via (a) subclassing and (b) the constructor\n    # \"extras\" argument.\n    extras = None\n\n    urls = None\n    titles = None\n    html_blocks = None\n    html_spans = None\n    html_removed_text = \"[HTML_REMOVED]\"  # for compat with markdown.py\n\n    # Used to track when we're inside an ordered or unordered list\n    # (see _ProcessListItems() for details):\n    list_level = 0\n\n    _ws_only_line_re = re.compile(r\"^[ \\t]+$\", re.M)\n\n    def __init__(self, html4tags=False, tab_width=4, safe_mode=None,\n                 extras=None, link_patterns=None, use_file_vars=False):\n        if html4tags:\n            self.empty_element_suffix = \">\"\n        else:\n            self.empty_element_suffix = \" />\"\n        self.tab_width = tab_width\n\n        # For compatibility with earlier markdown2.py and with\n        # markdown.py's safe_mode being a boolean,\n        #   safe_mode == True -> \"replace\"\n        if safe_mode is True:\n            self.safe_mode = \"replace\"\n        else:\n            self.safe_mode = safe_mode\n\n        # Massaging and building the \"extras\" info.\n        if self.extras is None:\n            self.extras = {}\n        elif not isinstance(self.extras, dict):\n            self.extras = dict([(e, None) for e in self.extras])\n        if extras:\n            if not isinstance(extras, dict):\n                extras = dict([(e, None) for e in extras])\n            self.extras.update(extras)\n        assert isinstance(self.extras, dict)\n        if \"toc\" in self.extras and not \"header-ids\" in self.extras:\n            self.extras[\"header-ids\"] = None   # \"toc\" implies \"header-ids\"\n        self._instance_extras = self.extras.copy()\n\n        self.link_patterns = link_patterns\n        self.use_file_vars = use_file_vars\n        self._outdent_re = re.compile(r'^(\\t|[ ]{1,%d})' % tab_width, re.M)\n\n        self._escape_table = g_escape_table.copy()\n        if \"smarty-pants\" in self.extras:\n            self._escape_table['\"'] = _hash_text('\"')\n            self._escape_table[\"'\"] = _hash_text(\"'\")\n\n    def reset(self):\n        self.urls = {}\n        self.titles = {}\n        self.html_blocks = {}\n        self.html_spans = {}\n        self.list_level = 0\n        self.extras = self._instance_extras.copy()\n        if \"footnotes\" in self.extras:\n            self.footnotes = {}\n            self.footnote_ids = []\n        if \"header-ids\" in self.extras:\n            self._count_from_header_id = {} # no `defaultdict` in Python 2.4\n        if \"metadata\" in self.extras:\n            self.metadata = {}\n\n    def convert(self, text):\n        \"\"\"Convert the given text.\"\"\"\n        # Main function. The order in which other subs are called here is\n        # essential. Link and image substitutions need to happen before\n        # _EscapeSpecialChars(), so that any *'s or _'s in the <a>\n        # and <img> tags get encoded.\n\n        # Clear the global hashes. If we don't clear these, you get conflicts\n        # from other articles when generating a page which contains more than\n        # one article (e.g. an index page that shows the N most recent\n        # articles):\n        self.reset()\n\n        if not isinstance(text, unicode):\n            #TODO: perhaps shouldn't presume UTF-8 for string input?\n            text = unicode(text, 'utf-8')\n\n        if self.use_file_vars:\n            # Look for emacs-style file variable hints.\n            emacs_vars = self._get_emacs_vars(text)\n            if \"markdown-extras\" in emacs_vars:\n                splitter = re.compile(\"[ ,]+\")\n                for e in splitter.split(emacs_vars[\"markdown-extras\"]):\n                    if '=' in e:\n                        ename, earg = e.split('=', 1)\n                        try:\n                            earg = int(earg)\n                        except ValueError:\n                            pass\n                    else:\n                        ename, earg = e, None\n                    self.extras[ename] = earg\n\n        # Standardize line endings:\n        text = re.sub(\"\\r\\n|\\r\", \"\\n\", text)\n\n        # Make sure $text ends with a couple of newlines:\n        text += \"\\n\\n\"\n\n        # Convert all tabs to spaces.\n        text = self._detab(text)\n\n        # Strip any lines consisting only of spaces and tabs.\n        # This makes subsequent regexen easier to write, because we can\n        # match consecutive blank lines with /\\n+/ instead of something\n        # contorted like /[ \\t]*\\n+/ .\n        text = self._ws_only_line_re.sub(\"\", text)\n\n        # strip metadata from head and extract\n        if \"metadata\" in self.extras:\n            text = self._extract_metadata(text)\n\n        text = self.preprocess(text)\n\n        if self.safe_mode:\n            text = self._hash_html_spans(text)\n\n        # Turn block-level HTML blocks into hash entries\n        text = self._hash_html_blocks(text, raw=True)\n\n        # Strip link definitions, store in hashes.\n        if \"footnotes\" in self.extras:\n            # Must do footnotes first because an unlucky footnote defn\n            # looks like a link defn:\n            #   [^4]: this \"looks like a link defn\"\n            text = self._strip_footnote_definitions(text)\n        text = self._strip_link_definitions(text)\n\n        text = self._run_block_gamut(text)\n\n        if \"footnotes\" in self.extras:\n            text = self._add_footnotes(text)\n\n        text = self.postprocess(text)\n\n        text = self._unescape_special_chars(text)\n\n        if self.safe_mode:\n            text = self._unhash_html_spans(text)\n\n        text += \"\\n\"\n\n        rv = UnicodeWithAttrs(text)\n        if \"toc\" in self.extras:\n            rv._toc = self._toc\n        if \"metadata\" in self.extras:\n            rv.metadata = self.metadata\n        return rv\n\n    def postprocess(self, text):\n        \"\"\"A hook for subclasses to do some postprocessing of the html, if\n        desired. This is called before unescaping of special chars and\n        unhashing of raw HTML spans.\n        \"\"\"\n        return text\n\n    def preprocess(self, text):\n        \"\"\"A hook for subclasses to do some preprocessing of the Markdown, if\n        desired. This is called after basic formatting of the text, but prior\n        to any extras, safe mode, etc. processing.\n        \"\"\"\n        return text\n\n    # Is metadata if the content starts with '---'-fenced `key: value`\n    # pairs. E.g. (indented for presentation):\n    #   ---\n    #   foo: bar\n    #   another-var: blah blah\n    #   ---\n    _metadata_pat = re.compile(\"\"\"^---[ \\t]*\\n((?:[ \\t]*[^ \\t:]+[ \\t]*:[^\\n]*\\n)+)---[ \\t]*\\n\"\"\")\n\n    def _extract_metadata(self, text):\n        # fast test\n        if not text.startswith(\"---\"):\n            return text\n        match = self._metadata_pat.match(text)\n        if not match:\n            return text\n\n        tail = text[len(match.group(0)):]\n        metadata_str = match.group(1).strip()\n        for line in metadata_str.split('\\n'):\n            key, value = line.split(':', 1)\n            self.metadata[key.strip()] = value.strip()\n\n        return tail\n\n\n    _emacs_oneliner_vars_pat = re.compile(r\"-\\*-\\s*([^\\r\\n]*?)\\s*-\\*-\", re.UNICODE)\n    # This regular expression is intended to match blocks like this:\n    #    PREFIX Local Variables: SUFFIX\n    #    PREFIX mode: Tcl SUFFIX\n    #    PREFIX End: SUFFIX\n    # Some notes:\n    # - \"[ \\t]\" is used instead of \"\\s\" to specifically exclude newlines\n    # - \"(\\r\\n|\\n|\\r)\" is used instead of \"$\" because the sre engine does\n    #   not like anything other than Unix-style line terminators.\n    _emacs_local_vars_pat = re.compile(r\"\"\"^\n        (?P<prefix>(?:[^\\r\\n|\\n|\\r])*?)\n        [\\ \\t]*Local\\ Variables:[\\ \\t]*\n        (?P<suffix>.*?)(?:\\r\\n|\\n|\\r)\n        (?P<content>.*?\\1End:)\n        \"\"\", re.IGNORECASE | re.MULTILINE | re.DOTALL | re.VERBOSE)\n\n    def _get_emacs_vars(self, text):\n        \"\"\"Return a dictionary of emacs-style local variables.\n\n        Parsing is done loosely according to this spec (and according to\n        some in-practice deviations from this):\n        http://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables\n        \"\"\"\n        emacs_vars = {}\n        SIZE = pow(2, 13) # 8kB\n\n        # Search near the start for a '-*-'-style one-liner of variables.\n        head = text[:SIZE]\n        if \"-*-\" in head:\n            match = self._emacs_oneliner_vars_pat.search(head)\n            if match:\n                emacs_vars_str = match.group(1)\n                assert '\\n' not in emacs_vars_str\n                emacs_var_strs = [s.strip() for s in emacs_vars_str.split(';')\n                                  if s.strip()]\n                if len(emacs_var_strs) == 1 and ':' not in emacs_var_strs[0]:\n                    # While not in the spec, this form is allowed by emacs:\n                    #   -*- Tcl -*-\n                    # where the implied \"variable\" is \"mode\". This form\n                    # is only allowed if there are no other variables.\n                    emacs_vars[\"mode\"] = emacs_var_strs[0].strip()\n                else:\n                    for emacs_var_str in emacs_var_strs:\n                        try:\n                            variable, value = emacs_var_str.strip().split(':', 1)\n                        except ValueError:\n                            log.debug(\"emacs variables error: malformed -*- \"\n                                      \"line: %r\", emacs_var_str)\n                            continue\n                        # Lowercase the variable name because Emacs allows \"Mode\"\n                        # or \"mode\" or \"MoDe\", etc.\n                        emacs_vars[variable.lower()] = value.strip()\n\n        tail = text[-SIZE:]\n        if \"Local Variables\" in tail:\n            match = self._emacs_local_vars_pat.search(tail)\n            if match:\n                prefix = match.group(\"prefix\")\n                suffix = match.group(\"suffix\")\n                lines = match.group(\"content\").splitlines(0)\n                #print \"prefix=%r, suffix=%r, content=%r, lines: %s\"\\\n                #      % (prefix, suffix, match.group(\"content\"), lines)\n\n                # Validate the Local Variables block: proper prefix and suffix\n                # usage.\n                for i, line in enumerate(lines):\n                    if not line.startswith(prefix):\n                        log.debug(\"emacs variables error: line '%s' \"\n                                  \"does not use proper prefix '%s'\"\n                                  % (line, prefix))\n                        return {}\n                    # Don't validate suffix on last line. Emacs doesn't care,\n                    # neither should we.\n                    if i != len(lines)-1 and not line.endswith(suffix):\n                        log.debug(\"emacs variables error: line '%s' \"\n                                  \"does not use proper suffix '%s'\"\n                                  % (line, suffix))\n                        return {}\n\n                # Parse out one emacs var per line.\n                continued_for = None\n                for line in lines[:-1]: # no var on the last line (\"PREFIX End:\")\n                    if prefix: line = line[len(prefix):] # strip prefix\n                    if suffix: line = line[:-len(suffix)] # strip suffix\n                    line = line.strip()\n                    if continued_for:\n                        variable = continued_for\n                        if line.endswith('\\\\'):\n                            line = line[:-1].rstrip()\n                        else:\n                            continued_for = None\n                        emacs_vars[variable] += ' ' + line\n                    else:\n                        try:\n                            variable, value = line.split(':', 1)\n                        except ValueError:\n                            log.debug(\"local variables error: missing colon \"\n                                      \"in local variables entry: '%s'\" % line)\n                            continue\n                        # Do NOT lowercase the variable name, because Emacs only\n                        # allows \"mode\" (and not \"Mode\", \"MoDe\", etc.) in this block.\n                        value = value.strip()\n                        if value.endswith('\\\\'):\n                            value = value[:-1].rstrip()\n                            continued_for = variable\n                        else:\n                            continued_for = None\n                        emacs_vars[variable] = value\n\n        # Unquote values.\n        for var, val in list(emacs_vars.items()):\n            if len(val) > 1 and (val.startswith('\"') and val.endswith('\"')\n               or val.startswith('\"') and val.endswith('\"')):\n                emacs_vars[var] = val[1:-1]\n\n        return emacs_vars\n\n    # Cribbed from a post by Bart Lateur:\n    # <http://www.nntp.perl.org/group/perl.macperl.anyperl/154>\n    _detab_re = re.compile(r'(.*?)\\t', re.M)\n    def _detab_sub(self, match):\n        g1 = match.group(1)\n        return g1 + (' ' * (self.tab_width - len(g1) % self.tab_width))\n    def _detab(self, text):\n        r\"\"\"Remove (leading?) tabs from a file.\n\n            >>> m = Markdown()\n            >>> m._detab(\"\\tfoo\")\n            '    foo'\n            >>> m._detab(\"  \\tfoo\")\n            '    foo'\n            >>> m._detab(\"\\t  foo\")\n            '      foo'\n            >>> m._detab(\"  foo\")\n            '  foo'\n            >>> m._detab(\"  foo\\n\\tbar\\tblam\")\n            '  foo\\n    bar blam'\n        \"\"\"\n        if '\\t' not in text:\n            return text\n        return self._detab_re.subn(self._detab_sub, text)[0]\n\n    # I broke out the html5 tags here and add them to _block_tags_a and\n    # _block_tags_b.  This way html5 tags are easy to keep track of.\n    _html5tags = '|article|aside|header|hgroup|footer|nav|section|figure|figcaption'\n\n    _block_tags_a = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del'\n    _block_tags_a += _html5tags\n\n    _strict_tag_block_re = re.compile(r\"\"\"\n        (                       # save in \\1\n            ^                   # start of line  (with re.M)\n            <(%s)               # start tag = \\2\n            \\b                  # word break\n            (.*\\n)*?            # any number of lines, minimally matching\n            </\\2>               # the matching end tag\n            [ \\t]*              # trailing spaces/tabs\n            (?=\\n+|\\Z)          # followed by a newline or end of document\n        )\n        \"\"\" % _block_tags_a,\n        re.X | re.M)\n\n    _block_tags_b = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math'\n    _block_tags_b += _html5tags\n\n    _liberal_tag_block_re = re.compile(r\"\"\"\n        (                       # save in \\1\n            ^                   # start of line  (with re.M)\n            <(%s)               # start tag = \\2\n            \\b                  # word break\n            (.*\\n)*?            # any number of lines, minimally matching\n            .*</\\2>             # the matching end tag\n            [ \\t]*              # trailing spaces/tabs\n            (?=\\n+|\\Z)          # followed by a newline or end of document\n        )\n        \"\"\" % _block_tags_b,\n        re.X | re.M)\n\n    _html_markdown_attr_re = re.compile(\n        r'''\\s+markdown=(\"1\"|'1')''')\n    def _hash_html_block_sub(self, match, raw=False):\n        html = match.group(1)\n        if raw and self.safe_mode:\n            html = self._sanitize_html(html)\n        elif 'markdown-in-html' in self.extras and 'markdown=' in html:\n            first_line = html.split('\\n', 1)[0]\n            m = self._html_markdown_attr_re.search(first_line)\n            if m:\n                lines = html.split('\\n')\n                middle = '\\n'.join(lines[1:-1])\n                last_line = lines[-1]\n                first_line = first_line[:m.start()] + first_line[m.end():]\n                f_key = _hash_text(first_line)\n                self.html_blocks[f_key] = first_line\n                l_key = _hash_text(last_line)\n                self.html_blocks[l_key] = last_line\n                return ''.join([\"\\n\\n\", f_key,\n                    \"\\n\\n\", middle, \"\\n\\n\",\n                    l_key, \"\\n\\n\"])\n        key = _hash_text(html)\n        self.html_blocks[key] = html\n        return \"\\n\\n\" + key + \"\\n\\n\"\n\n    def _hash_html_blocks(self, text, raw=False):\n        \"\"\"Hashify HTML blocks\n\n        We only want to do this for block-level HTML tags, such as headers,\n        lists, and tables. That's because we still want to wrap <p>s around\n        \"paragraphs\" that are wrapped in non-block-level tags, such as anchors,\n        phrase emphasis, and spans. The list of tags we're looking for is\n        hard-coded.\n\n        @param raw {boolean} indicates if these are raw HTML blocks in\n            the original source. It makes a difference in \"safe\" mode.\n        \"\"\"\n        if '<' not in text:\n            return text\n\n        # Pass `raw` value into our calls to self._hash_html_block_sub.\n        hash_html_block_sub = _curry(self._hash_html_block_sub, raw=raw)\n\n        # First, look for nested blocks, e.g.:\n        #   <div>\n        #       <div>\n        #       tags for inner block must be indented.\n        #       </div>\n        #   </div>\n        #\n        # The outermost tags must start at the left margin for this to match, and\n        # the inner nested divs must be indented.\n        # We need to do this before the next, more liberal match, because the next\n        # match will start at the first `<div>` and stop at the first `</div>`.\n        text = self._strict_tag_block_re.sub(hash_html_block_sub, text)\n\n        # Now match more liberally, simply from `\\n<tag>` to `</tag>\\n`\n        text = self._liberal_tag_block_re.sub(hash_html_block_sub, text)\n\n        # Special case just for <hr />. It was easier to make a special\n        # case than to make the other regex more complicated.\n        if \"<hr\" in text:\n            _hr_tag_re = _hr_tag_re_from_tab_width(self.tab_width)\n            text = _hr_tag_re.sub(hash_html_block_sub, text)\n\n        # Special case for standalone HTML comments:\n        if \"<!--\" in text:\n            start = 0\n            while True:\n                # Delimiters for next comment block.\n                try:\n                    start_idx = text.index(\"<!--\", start)\n                except ValueError:\n                    break\n                try:\n                    end_idx = text.index(\"-->\", start_idx) + 3\n                except ValueError:\n                    break\n\n                # Start position for next comment block search.\n                start = end_idx\n\n                # Validate whitespace before comment.\n                if start_idx:\n                    # - Up to `tab_width - 1` spaces before start_idx.\n                    for i in range(self.tab_width - 1):\n                        if text[start_idx - 1] != ' ':\n                            break\n                        start_idx -= 1\n                        if start_idx == 0:\n                            break\n                    # - Must be preceded by 2 newlines or hit the start of\n                    #   the document.\n                    if start_idx == 0:\n                        pass\n                    elif start_idx == 1 and text[0] == '\\n':\n                        start_idx = 0  # to match minute detail of Markdown.pl regex\n                    elif text[start_idx-2:start_idx] == '\\n\\n':\n                        pass\n                    else:\n                        break\n\n                # Validate whitespace after comment.\n                # - Any number of spaces and tabs.\n                while end_idx < len(text):\n                    if text[end_idx] not in ' \\t':\n                        break\n                    end_idx += 1\n                # - Must be following by 2 newlines or hit end of text.\n                if text[end_idx:end_idx+2] not in ('', '\\n', '\\n\\n'):\n                    continue\n\n                # Escape and hash (must match `_hash_html_block_sub`).\n                html = text[start_idx:end_idx]\n                if raw and self.safe_mode:\n                    html = self._sanitize_html(html)\n                key = _hash_text(html)\n                self.html_blocks[key] = html\n                text = text[:start_idx] + \"\\n\\n\" + key + \"\\n\\n\" + text[end_idx:]\n\n        if \"xml\" in self.extras:\n            # Treat XML processing instructions and namespaced one-liner\n            # tags as if they were block HTML tags. E.g., if standalone\n            # (i.e. are their own paragraph), the following do not get\n            # wrapped in a <p> tag:\n            #    <?foo bar?>\n            #\n            #    <xi:include xmlns:xi=\"http://www.w3.org/2001/XInclude\" href=\"chapter_1.md\"/>\n            _xml_oneliner_re = _xml_oneliner_re_from_tab_width(self.tab_width)\n            text = _xml_oneliner_re.sub(hash_html_block_sub, text)\n\n        return text\n\n    def _strip_link_definitions(self, text):\n        # Strips link definitions from text, stores the URLs and titles in\n        # hash references.\n        less_than_tab = self.tab_width - 1\n\n        # Link defs are in the form:\n        #   [id]: url \"optional title\"\n        _link_def_re = re.compile(r\"\"\"\n            ^[ ]{0,%d}\\[(.+)\\]: # id = \\1\n              [ \\t]*\n              \\n?               # maybe *one* newline\n              [ \\t]*\n            <?(.+?)>?           # url = \\2\n              [ \\t]*\n            (?:\n                \\n?             # maybe one newline\n                [ \\t]*\n                (?<=\\s)         # lookbehind for whitespace\n                ['\"(]\n                ([^\\n]*)        # title = \\3\n                ['\")]\n                [ \\t]*\n            )?  # title is optional\n            (?:\\n+|\\Z)\n            \"\"\" % less_than_tab, re.X | re.M | re.U)\n        return _link_def_re.sub(self._extract_link_def_sub, text)\n\n    def _extract_link_def_sub(self, match):\n        id, url, title = match.groups()\n        key = id.lower()    # Link IDs are case-insensitive\n        self.urls[key] = self._encode_amps_and_angles(url)\n        if title:\n            self.titles[key] = title\n        return \"\"\n\n    def _extract_footnote_def_sub(self, match):\n        id, text = match.groups()\n        text = _dedent(text, skip_first_line=not text.startswith('\\n')).strip()\n        normed_id = re.sub(r'\\W', '-', id)\n        # Ensure footnote text ends with a couple newlines (for some\n        # block gamut matches).\n        self.footnotes[normed_id] = text + \"\\n\\n\"\n        return \"\"\n\n    def _strip_footnote_definitions(self, text):\n        \"\"\"A footnote definition looks like this:\n\n            [^note-id]: Text of the note.\n\n                May include one or more indented paragraphs.\n\n        Where,\n        - The 'note-id' can be pretty much anything, though typically it\n          is the number of the footnote.\n        - The first paragraph may start on the next line, like so:\n\n            [^note-id]:\n                Text of the note.\n        \"\"\"\n        less_than_tab = self.tab_width - 1\n        footnote_def_re = re.compile(r'''\n            ^[ ]{0,%d}\\[\\^(.+)\\]:   # id = \\1\n            [ \\t]*\n            (                       # footnote text = \\2\n              # First line need not start with the spaces.\n              (?:\\s*.*\\n+)\n              (?:\n                (?:[ ]{%d} | \\t)  # Subsequent lines must be indented.\n                .*\\n+\n              )*\n            )\n            # Lookahead for non-space at line-start, or end of doc.\n            (?:(?=^[ ]{0,%d}\\S)|\\Z)\n            ''' % (less_than_tab, self.tab_width, self.tab_width),\n            re.X | re.M)\n        return footnote_def_re.sub(self._extract_footnote_def_sub, text)\n\n\n    _hr_data = [\n        ('*', re.compile(r\"^[ ]{0,3}\\*(.*?)$\", re.M)),\n        ('-', re.compile(r\"^[ ]{0,3}\\-(.*?)$\", re.M)),\n        ('_', re.compile(r\"^[ ]{0,3}\\_(.*?)$\", re.M)),\n    ]\n\n    def _run_block_gamut(self, text):\n        # These are all the transformations that form block-level\n        # tags like paragraphs, headers, and list items.\n\n        if \"fenced-code-blocks\" in self.extras:\n            text = self._do_fenced_code_blocks(text)\n\n        text = self._do_headers(text)\n\n        # Do Horizontal Rules:\n        # On the number of spaces in horizontal rules: The spec is fuzzy: \"If\n        # you wish, you may use spaces between the hyphens or asterisks.\"\n        # Markdown.pl 1.0.1's hr regexes limit the number of spaces between the\n        # hr chars to one or two. We'll reproduce that limit here.\n        hr = \"\\n<hr\"+self.empty_element_suffix+\"\\n\"\n        for ch, regex in self._hr_data:\n            if ch in text:\n                for m in reversed(list(regex.finditer(text))):\n                    tail = m.group(1).rstrip()\n                    if not tail.strip(ch + ' ') and tail.count(\"   \") == 0:\n                        start, end = m.span()\n                        text = text[:start] + hr + text[end:]\n\n        text = self._do_lists(text)\n\n        if \"pyshell\" in self.extras:\n            text = self._prepare_pyshell_blocks(text)\n        if \"wiki-tables\" in self.extras:\n            text = self._do_wiki_tables(text)\n\n        text = self._do_code_blocks(text)\n\n        text = self._do_block_quotes(text)\n\n        # We already ran _HashHTMLBlocks() before, in Markdown(), but that\n        # was to escape raw HTML in the original Markdown source. This time,\n        # we're escaping the markup we've just created, so that we don't wrap\n        # <p> tags around block-level tags.\n        text = self._hash_html_blocks(text)\n\n        text = self._form_paragraphs(text)\n\n        return text\n\n    def _pyshell_block_sub(self, match):\n        lines = match.group(0).splitlines(0)\n        _dedentlines(lines)\n        indent = ' ' * self.tab_width\n        s = ('\\n' # separate from possible cuddled paragraph\n             + indent + ('\\n'+indent).join(lines)\n             + '\\n\\n')\n        return s\n\n    def _prepare_pyshell_blocks(self, text):\n        \"\"\"Ensure that Python interactive shell sessions are put in\n        code blocks -- even if not properly indented.\n        \"\"\"\n        if \">>>\" not in text:\n            return text\n\n        less_than_tab = self.tab_width - 1\n        _pyshell_block_re = re.compile(r\"\"\"\n            ^([ ]{0,%d})>>>[ ].*\\n   # first line\n            ^(\\1.*\\S+.*\\n)*         # any number of subsequent lines\n            ^\\n                     # ends with a blank line\n            \"\"\" % less_than_tab, re.M | re.X)\n\n        return _pyshell_block_re.sub(self._pyshell_block_sub, text)\n\n    def _wiki_table_sub(self, match):\n        ttext = match.group(0).strip()\n        #print 'wiki table: %r' % match.group(0)\n        rows = []\n        for line in ttext.splitlines(0):\n            line = line.strip()[2:-2].strip()\n            row = [c.strip() for c in re.split(r'(?<!\\\\)\\|\\|', line)]\n            rows.append(row)\n        #pprint(rows)\n        hlines = ['<table>', '<tbody>']\n        for row in rows:\n            hrow = ['<tr>']\n            for cell in row:\n                hrow.append('<td>')\n                hrow.append(self._run_span_gamut(cell))\n                hrow.append('</td>')\n            hrow.append('</tr>')\n            hlines.append(''.join(hrow))\n        hlines += ['</tbody>', '</table>']\n        return '\\n'.join(hlines) + '\\n'\n\n    def _do_wiki_tables(self, text):\n        # Optimization.\n        if \"||\" not in text:\n            return text\n\n        less_than_tab = self.tab_width - 1\n        wiki_table_re = re.compile(r'''\n            (?:(?<=\\n\\n)|\\A\\n?)            # leading blank line\n            ^([ ]{0,%d})\\|\\|.+?\\|\\|[ ]*\\n  # first line\n            (^\\1\\|\\|.+?\\|\\|\\n)*        # any number of subsequent lines\n            ''' % less_than_tab, re.M | re.X)\n        return wiki_table_re.sub(self._wiki_table_sub, text)\n\n    def _run_span_gamut(self, text):\n        # These are all the transformations that occur *within* block-level\n        # tags like paragraphs, headers, and list items.\n\n        text = self._do_code_spans(text)\n\n        text = self._escape_special_chars(text)\n\n        # Process anchor and image tags.\n        text = self._do_links(text)\n\n        # Make links out of things like `<http://example.com/>`\n        # Must come after _do_links(), because you can use < and >\n        # delimiters in inline links like [this](<url>).\n        text = self._do_auto_links(text)\n\n        if \"link-patterns\" in self.extras:\n            text = self._do_link_patterns(text)\n\n        text = self._encode_amps_and_angles(text)\n\n        text = self._do_italics_and_bold(text)\n\n        if \"smarty-pants\" in self.extras:\n            text = self._do_smart_punctuation(text)\n\n        # Do hard breaks:\n        text = re.sub(r\" {2,}\\n\", \" <br%s\\n\" % self.empty_element_suffix, text)\n\n        return text\n\n    # \"Sorta\" because auto-links are identified as \"tag\" tokens.\n    _sorta_html_tokenize_re = re.compile(r\"\"\"\n        (\n            # tag\n            </?\n            (?:\\w+)                                     # tag name\n            (?:\\s+(?:[\\w-]+:)?[\\w-]+=(?:\".*?\"|'.*?'))*  # attributes\n            \\s*/?>\n            |\n            # auto-link (e.g., <http://www.activestate.com/>)\n            <\\w+[^>]*>\n            |\n            <!--.*?-->      # comment\n            |\n            <\\?.*?\\?>       # processing instruction\n        )\n        \"\"\", re.X)\n\n    def _escape_special_chars(self, text):\n        # Python markdown note: the HTML tokenization here differs from\n        # that in Markdown.pl, hence the behaviour for subtle cases can\n        # differ (I believe the tokenizer here does a better job because\n        # it isn't susceptible to unmatched '<' and '>' in HTML tags).\n        # Note, however, that '>' is not allowed in an auto-link URL\n        # here.\n        escaped = []\n        is_html_markup = False\n        for token in self._sorta_html_tokenize_re.split(text):\n            if is_html_markup:\n                # Within tags/HTML-comments/auto-links, encode * and _\n                # so they don't conflict with their use in Markdown for\n                # italics and strong.  We're replacing each such\n                # character with its corresponding MD5 checksum value;\n                # this is likely overkill, but it should prevent us from\n                # colliding with the escape values by accident.\n                escaped.append(token.replace('*', self._escape_table['*'])\n                                    .replace('_', self._escape_table['_']))\n            else:\n                escaped.append(self._encode_backslash_escapes(token))\n            is_html_markup = not is_html_markup\n        return ''.join(escaped)\n\n    def _hash_html_spans(self, text):\n        # Used for safe_mode.\n\n        def _is_auto_link(s):\n            if ':' in s and self._auto_link_re.match(s):\n                return True\n            elif '@' in s and self._auto_email_link_re.match(s):\n                return True\n            return False\n\n        tokens = []\n        is_html_markup = False\n        for token in self._sorta_html_tokenize_re.split(text):\n            if is_html_markup and not _is_auto_link(token):\n                sanitized = self._sanitize_html(token)\n                key = _hash_text(sanitized)\n                self.html_spans[key] = sanitized\n                tokens.append(key)\n            else:\n                tokens.append(token)\n            is_html_markup = not is_html_markup\n        return ''.join(tokens)\n\n    def _unhash_html_spans(self, text):\n        for key, sanitized in list(self.html_spans.items()):\n            text = text.replace(key, sanitized)\n        return text\n\n    def _sanitize_html(self, s):\n        if self.safe_mode == \"replace\":\n            return self.html_removed_text\n        elif self.safe_mode == \"escape\":\n            replacements = [\n                ('&', '&amp;'),\n                ('<', '&lt;'),\n                ('>', '&gt;'),\n            ]\n            for before, after in replacements:\n                s = s.replace(before, after)\n            return s\n        else:\n            raise MarkdownError(\"invalid value for 'safe_mode': %r (must be \"\n                                \"'escape' or 'replace')\" % self.safe_mode)\n\n    _tail_of_inline_link_re = re.compile(r'''\n          # Match tail of: [text](/url/) or [text](/url/ \"title\")\n          \\(            # literal paren\n            [ \\t]*\n            (?P<url>            # \\1\n                <.*?>\n                |\n                .*?\n            )\n            [ \\t]*\n            (                   # \\2\n              (['\"])            # quote char = \\3\n              (?P<title>.*?)\n              \\3                # matching quote\n            )?                  # title is optional\n          \\)\n        ''', re.X | re.S)\n    _tail_of_reference_link_re = re.compile(r'''\n          # Match tail of: [text][id]\n          [ ]?          # one optional space\n          (?:\\n[ ]*)?   # one optional newline followed by spaces\n          \\[\n            (?P<id>.*?)\n          \\]\n        ''', re.X | re.S)\n\n    def _do_links(self, text):\n        \"\"\"Turn Markdown link shortcuts into XHTML <a> and <img> tags.\n\n        This is a combination of Markdown.pl's _DoAnchors() and\n        _DoImages(). They are done together because that simplified the\n        approach. It was necessary to use a different approach than\n        Markdown.pl because of the lack of atomic matching support in\n        Python's regex engine used in $g_nested_brackets.\n        \"\"\"\n        MAX_LINK_TEXT_SENTINEL = 3000  # markdown2 issue 24\n\n        # `anchor_allowed_pos` is used to support img links inside\n        # anchors, but not anchors inside anchors. An anchor's start\n        # pos must be `>= anchor_allowed_pos`.\n        anchor_allowed_pos = 0\n\n        curr_pos = 0\n        while True: # Handle the next link.\n            # The next '[' is the start of:\n            # - an inline anchor:   [text](url \"title\")\n            # - a reference anchor: [text][id]\n            # - an inline img:      ![text](url \"title\")\n            # - a reference img:    ![text][id]\n            # - a footnote ref:     [^id]\n            #   (Only if 'footnotes' extra enabled)\n            # - a footnote defn:    [^id]: ...\n            #   (Only if 'footnotes' extra enabled) These have already\n            #   been stripped in _strip_footnote_definitions() so no\n            #   need to watch for them.\n            # - a link definition:  [id]: url \"title\"\n            #   These have already been stripped in\n            #   _strip_link_definitions() so no need to watch for them.\n            # - not markup:         [...anything else...\n            try:\n                start_idx = text.index('[', curr_pos)\n            except ValueError:\n                break\n            text_length = len(text)\n\n            # Find the matching closing ']'.\n            # Markdown.pl allows *matching* brackets in link text so we\n            # will here too. Markdown.pl *doesn't* currently allow\n            # matching brackets in img alt text -- we'll differ in that\n            # regard.\n            bracket_depth = 0\n            for p in range(start_idx+1, min(start_idx+MAX_LINK_TEXT_SENTINEL,\n                                            text_length)):\n                ch = text[p]\n                if ch == ']':\n                    bracket_depth -= 1\n                    if bracket_depth < 0:\n                        break\n                elif ch == '[':\n                    bracket_depth += 1\n            else:\n                # Closing bracket not found within sentinel length.\n                # This isn't markup.\n                curr_pos = start_idx + 1\n                continue\n            link_text = text[start_idx+1:p]\n\n            # Possibly a footnote ref?\n            if \"footnotes\" in self.extras and link_text.startswith(\"^\"):\n                normed_id = re.sub(r'\\W', '-', link_text[1:])\n                if normed_id in self.footnotes:\n                    self.footnote_ids.append(normed_id)\n                    result = '<sup class=\"footnote-ref\" id=\"fnref-%s\">' \\\n                             '<a href=\"#fn-%s\">%s</a></sup>' \\\n                             % (normed_id, normed_id, len(self.footnote_ids))\n                    text = text[:start_idx] + result + text[p+1:]\n                else:\n                    # This id isn't defined, leave the markup alone.\n                    curr_pos = p+1\n                continue\n\n            # Now determine what this is by the remainder.\n            p += 1\n            if p == text_length:\n                return text\n\n            # Inline anchor or img?\n            if text[p] == '(': # attempt at perf improvement\n                match = self._tail_of_inline_link_re.match(text, p)\n                if match:\n                    # Handle an inline anchor or img.\n                    is_img = start_idx > 0 and text[start_idx-1] == \"!\"\n                    if is_img:\n                        start_idx -= 1\n\n                    url, title = match.group(\"url\"), match.group(\"title\")\n                    if url and url[0] == '<':\n                        url = url[1:-1]  # '<url>' -> 'url'\n                    # We've got to encode these to avoid conflicting\n                    # with italics/bold.\n                    url = url.replace('*', self._escape_table['*']) \\\n                             .replace('_', self._escape_table['_'])\n                    if title:\n                        title_str = ' title=\"%s\"' % (\n                            _xml_escape_attr(title)\n                                .replace('*', self._escape_table['*'])\n                                .replace('_', self._escape_table['_']))\n                    else:\n                        title_str = ''\n                    if is_img:\n                        result = '<img src=\"%s\" alt=\"%s\"%s%s' \\\n                            % (url.replace('\"', '&quot;'),\n                               _xml_escape_attr(link_text),\n                               title_str, self.empty_element_suffix)\n                        if \"smarty-pants\" in self.extras:\n                            result = result.replace('\"', self._escape_table['\"'])\n                        curr_pos = start_idx + len(result)\n                        text = text[:start_idx] + result + text[match.end():]\n                    elif start_idx >= anchor_allowed_pos:\n                        result_head = '<a href=\"%s\"%s>' % (url, title_str)\n                        result = '%s%s</a>' % (result_head, link_text)\n                        if \"smarty-pants\" in self.extras:\n                            result = result.replace('\"', self._escape_table['\"'])\n                        # <img> allowed from curr_pos on, <a> from\n                        # anchor_allowed_pos on.\n                        curr_pos = start_idx + len(result_head)\n                        anchor_allowed_pos = start_idx + len(result)\n                        text = text[:start_idx] + result + text[match.end():]\n                    else:\n                        # Anchor not allowed here.\n                        curr_pos = start_idx + 1\n                    continue\n\n            # Reference anchor or img?\n            else:\n                match = self._tail_of_reference_link_re.match(text, p)\n                if match:\n                    # Handle a reference-style anchor or img.\n                    is_img = start_idx > 0 and text[start_idx-1] == \"!\"\n                    if is_img:\n                        start_idx -= 1\n                    link_id = match.group(\"id\").lower()\n                    if not link_id:\n                        link_id = link_text.lower()  # for links like [this][]\n                    if link_id in self.urls:\n                        url = self.urls[link_id]\n                        # We've got to encode these to avoid conflicting\n                        # with italics/bold.\n                        url = url.replace('*', self._escape_table['*']) \\\n                                 .replace('_', self._escape_table['_'])\n                        title = self.titles.get(link_id)\n                        if title:\n                            before = title\n                            title = _xml_escape_attr(title) \\\n                                .replace('*', self._escape_table['*']) \\\n                                .replace('_', self._escape_table['_'])\n                            title_str = ' title=\"%s\"' % title\n                        else:\n                            title_str = ''\n                        if is_img:\n                            result = '<img src=\"%s\" alt=\"%s\"%s%s' \\\n                                % (url.replace('\"', '&quot;'),\n                                   link_text.replace('\"', '&quot;'),\n                                   title_str, self.empty_element_suffix)\n                            if \"smarty-pants\" in self.extras:\n                                result = result.replace('\"', self._escape_table['\"'])\n                            curr_pos = start_idx + len(result)\n                            text = text[:start_idx] + result + text[match.end():]\n                        elif start_idx >= anchor_allowed_pos:\n                            result = '<a href=\"%s\"%s>%s</a>' \\\n                                % (url, title_str, link_text)\n                            result_head = '<a href=\"%s\"%s>' % (url, title_str)\n                            result = '%s%s</a>' % (result_head, link_text)\n                            if \"smarty-pants\" in self.extras:\n                                result = result.replace('\"', self._escape_table['\"'])\n                            # <img> allowed from curr_pos on, <a> from\n                            # anchor_allowed_pos on.\n                            curr_pos = start_idx + len(result_head)\n                            anchor_allowed_pos = start_idx + len(result)\n                            text = text[:start_idx] + result + text[match.end():]\n                        else:\n                            # Anchor not allowed here.\n                            curr_pos = start_idx + 1\n                    else:\n                        # This id isn't defined, leave the markup alone.\n                        curr_pos = match.end()\n                    continue\n\n            # Otherwise, it isn't markup.\n            curr_pos = start_idx + 1\n\n        return text\n\n    def header_id_from_text(self, text, prefix, n):\n        \"\"\"Generate a header id attribute value from the given header\n        HTML content.\n\n        This is only called if the \"header-ids\" extra is enabled.\n        Subclasses may override this for different header ids.\n\n        @param text {str} The text of the header tag\n        @param prefix {str} The requested prefix for header ids. This is the\n            value of the \"header-ids\" extra key, if any. Otherwise, None.\n        @param n {int} The <hN> tag number, i.e. `1` for an <h1> tag.\n        @returns {str} The value for the header tag's \"id\" attribute. Return\n            None to not have an id attribute and to exclude this header from\n            the TOC (if the \"toc\" extra is specified).\n        \"\"\"\n        header_id = _slugify(text)\n        if prefix and isinstance(prefix, base_string_type):\n            header_id = prefix + '-' + header_id\n        if header_id in self._count_from_header_id:\n            self._count_from_header_id[header_id] += 1\n            header_id += '-%s' % self._count_from_header_id[header_id]\n        else:\n            self._count_from_header_id[header_id] = 1\n        return header_id\n\n    _toc = None\n    def _toc_add_entry(self, level, id, name):\n        if self._toc is None:\n            self._toc = []\n        self._toc.append((level, id, self._unescape_special_chars(name)))\n\n    _setext_h_re = re.compile(r'^(.+)[ \\t]*\\n(=+|-+)[ \\t]*\\n+', re.M)\n    def _setext_h_sub(self, match):\n        n = {\"=\": 1, \"-\": 2}[match.group(2)[0]]\n        demote_headers = self.extras.get(\"demote-headers\")\n        if demote_headers:\n            n = min(n + demote_headers, 6)\n        header_id_attr = \"\"\n        if \"header-ids\" in self.extras:\n            header_id = self.header_id_from_text(match.group(1),\n                self.extras[\"header-ids\"], n)\n            if header_id:\n                header_id_attr = ' id=\"%s\"' % header_id\n        html = self._run_span_gamut(match.group(1))\n        if \"toc\" in self.extras and header_id:\n            self._toc_add_entry(n, header_id, html)\n        return \"<h%d%s>%s</h%d>\\n\\n\" % (n, header_id_attr, html, n)\n\n    _atx_h_re = re.compile(r'''\n        ^(\\#{1,6})  # \\1 = string of #'s\n        [ \\t]+\n        (.+?)       # \\2 = Header text\n        [ \\t]*\n        (?<!\\\\)     # ensure not an escaped trailing '#'\n        \\#*         # optional closing #'s (not counted)\n        \\n+\n        ''', re.X | re.M)\n    def _atx_h_sub(self, match):\n        n = len(match.group(1))\n        demote_headers = self.extras.get(\"demote-headers\")\n        if demote_headers:\n            n = min(n + demote_headers, 6)\n        header_id_attr = \"\"\n        if \"header-ids\" in self.extras:\n            header_id = self.header_id_from_text(match.group(2),\n                self.extras[\"header-ids\"], n)\n            if header_id:\n                header_id_attr = ' id=\"%s\"' % header_id\n        html = self._run_span_gamut(match.group(2))\n        if \"toc\" in self.extras and header_id:\n            self._toc_add_entry(n, header_id, html)\n        return \"<h%d%s>%s</h%d>\\n\\n\" % (n, header_id_attr, html, n)\n\n    def _do_headers(self, text):\n        # Setext-style headers:\n        #     Header 1\n        #     ========\n        #\n        #     Header 2\n        #     --------\n        text = self._setext_h_re.sub(self._setext_h_sub, text)\n\n        # atx-style headers:\n        #   # Header 1\n        #   ## Header 2\n        #   ## Header 2 with closing hashes ##\n        #   ...\n        #   ###### Header 6\n        text = self._atx_h_re.sub(self._atx_h_sub, text)\n\n        return text\n\n\n    _marker_ul_chars  = '*+-'\n    _marker_any = r'(?:[%s]|\\d+\\.)' % _marker_ul_chars\n    _marker_ul = '(?:[%s])' % _marker_ul_chars\n    _marker_ol = r'(?:\\d+\\.)'\n\n    def _list_sub(self, match):\n        lst = match.group(1)\n        lst_type = match.group(3) in self._marker_ul_chars and \"ul\" or \"ol\"\n        result = self._process_list_items(lst)\n        if self.list_level:\n            return \"<%s>\\n%s</%s>\\n\" % (lst_type, result, lst_type)\n        else:\n            return \"<%s>\\n%s</%s>\\n\\n\" % (lst_type, result, lst_type)\n\n    def _do_lists(self, text):\n        # Form HTML ordered (numbered) and unordered (bulleted) lists.\n\n        # Iterate over each *non-overlapping* list match.\n        pos = 0\n        while True:\n            # Find the *first* hit for either list style (ul or ol). We\n            # match ul and ol separately to avoid adjacent lists of different\n            # types running into each other (see issue #16).\n            hits = []\n            for marker_pat in (self._marker_ul, self._marker_ol):\n                less_than_tab = self.tab_width - 1\n                whole_list = r'''\n                    (                   # \\1 = whole list\n                      (                 # \\2\n                        [ ]{0,%d}\n                        (%s)            # \\3 = first list item marker\n                        [ \\t]+\n                        (?!\\ *\\3\\ )     # '- - - ...' isn't a list. See 'not_quite_a_list' test case.\n                      )\n                      (?:.+?)\n                      (                 # \\4\n                          \\Z\n                        |\n                          \\n{2,}\n                          (?=\\S)\n                          (?!           # Negative lookahead for another list item marker\n                            [ \\t]*\n                            %s[ \\t]+\n                          )\n                      )\n                    )\n                ''' % (less_than_tab, marker_pat, marker_pat)\n                if self.list_level:  # sub-list\n                    list_re = re.compile(\"^\"+whole_list, re.X | re.M | re.S)\n                else:\n                    list_re = re.compile(r\"(?:(?<=\\n\\n)|\\A\\n?)\"+whole_list,\n                                         re.X | re.M | re.S)\n                match = list_re.search(text, pos)\n                if match:\n                    hits.append((match.start(), match))\n            if not hits:\n                break\n            hits.sort()\n            match = hits[0][1]\n            start, end = match.span()\n            text = text[:start] + self._list_sub(match) + text[end:]\n            pos = end\n\n        return text\n\n    _list_item_re = re.compile(r'''\n        (\\n)?                   # leading line = \\1\n        (^[ \\t]*)               # leading whitespace = \\2\n        (?P<marker>%s) [ \\t]+   # list marker = \\3\n        ((?:.+?)                # list item text = \\4\n         (\\n{1,2}))             # eols = \\5\n        (?= \\n* (\\Z | \\2 (?P<next_marker>%s) [ \\t]+))\n        ''' % (_marker_any, _marker_any),\n        re.M | re.X | re.S)\n\n    _last_li_endswith_two_eols = False\n    def _list_item_sub(self, match):\n        item = match.group(4)\n        leading_line = match.group(1)\n        leading_space = match.group(2)\n        if leading_line or \"\\n\\n\" in item or self._last_li_endswith_two_eols:\n            item = self._run_block_gamut(self._outdent(item))\n        else:\n            # Recursion for sub-lists:\n            item = self._do_lists(self._outdent(item))\n            if item.endswith('\\n'):\n                item = item[:-1]\n            item = self._run_span_gamut(item)\n        self._last_li_endswith_two_eols = (len(match.group(5)) == 2)\n        return \"<li>%s</li>\\n\" % item\n\n    def _process_list_items(self, list_str):\n        # Process the contents of a single ordered or unordered list,\n        # splitting it into individual list items.\n\n        # The $g_list_level global keeps track of when we're inside a list.\n        # Each time we enter a list, we increment it; when we leave a list,\n        # we decrement. If it's zero, we're not in a list anymore.\n        #\n        # We do this because when we're not inside a list, we want to treat\n        # something like this:\n        #\n        #       I recommend upgrading to version\n        #       8. Oops, now this line is treated\n        #       as a sub-list.\n        #\n        # As a single paragraph, despite the fact that the second line starts\n        # with a digit-period-space sequence.\n        #\n        # Whereas when we're inside a list (or sub-list), that line will be\n        # treated as the start of a sub-list. What a kludge, huh? This is\n        # an aspect of Markdown's syntax that's hard to parse perfectly\n        # without resorting to mind-reading. Perhaps the solution is to\n        # change the syntax rules such that sub-lists must start with a\n        # starting cardinal number; e.g. \"1.\" or \"a.\".\n        self.list_level += 1\n        self._last_li_endswith_two_eols = False\n        list_str = list_str.rstrip('\\n') + '\\n'\n        list_str = self._list_item_re.sub(self._list_item_sub, list_str)\n        self.list_level -= 1\n        return list_str\n\n    def _get_pygments_lexer(self, lexer_name):\n        try:\n            from pygments import lexers, util\n        except ImportError:\n            return None\n        try:\n            return lexers.get_lexer_by_name(lexer_name)\n        except util.ClassNotFound:\n            return None\n\n    def _color_with_pygments(self, codeblock, lexer, **formatter_opts):\n        import pygments\n        import pygments.formatters\n\n        class HtmlCodeFormatter(pygments.formatters.HtmlFormatter):\n            def _wrap_code(self, inner):\n                \"\"\"A function for use in a Pygments Formatter which\n                wraps in <code> tags.\n                \"\"\"\n                yield 0, \"<code>\"\n                for tup in inner:\n                    yield tup\n                yield 0, \"</code>\"\n\n            def wrap(self, source, outfile):\n                \"\"\"Return the source with a code, pre, and div.\"\"\"\n                return self._wrap_div(self._wrap_pre(self._wrap_code(source)))\n\n        formatter_opts.setdefault(\"cssclass\", \"codehilite\")\n        formatter = HtmlCodeFormatter(**formatter_opts)\n        return pygments.highlight(codeblock, lexer, formatter)\n\n    def _code_block_sub(self, match, is_fenced_code_block=False):\n        lexer_name = None\n        if is_fenced_code_block:\n            lexer_name = match.group(1)\n            if lexer_name:\n                formatter_opts = self.extras['fenced-code-blocks'] or {}\n            codeblock = match.group(2)\n            codeblock = codeblock[:-1]  # drop one trailing newline\n        else:\n            codeblock = match.group(1)\n            codeblock = self._outdent(codeblock)\n            codeblock = self._detab(codeblock)\n            codeblock = codeblock.lstrip('\\n')  # trim leading newlines\n            codeblock = codeblock.rstrip()      # trim trailing whitespace\n\n            # Note: \"code-color\" extra is DEPRECATED.\n            if \"code-color\" in self.extras and codeblock.startswith(\":::\"):\n                lexer_name, rest = codeblock.split('\\n', 1)\n                lexer_name = lexer_name[3:].strip()\n                codeblock = rest.lstrip(\"\\n\")   # Remove lexer declaration line.\n                formatter_opts = self.extras['code-color'] or {}\n\n        if lexer_name:\n            lexer = self._get_pygments_lexer(lexer_name)\n            if lexer:\n                colored = self._color_with_pygments(codeblock, lexer,\n                                                    **formatter_opts)\n                return \"\\n\\n%s\\n\\n\" % colored\n\n        codeblock = self._encode_code(codeblock)\n        pre_class_str = self._html_class_str_from_tag(\"pre\")\n        code_class_str = self._html_class_str_from_tag(\"code\")\n        return \"\\n\\n<pre%s><code%s>%s\\n</code></pre>\\n\\n\" % (\n            pre_class_str, code_class_str, codeblock)\n\n    def _html_class_str_from_tag(self, tag):\n        \"\"\"Get the appropriate ' class=\"...\"' string (note the leading\n        space), if any, for the given tag.\n        \"\"\"\n        if \"html-classes\" not in self.extras:\n            return \"\"\n        try:\n            html_classes_from_tag = self.extras[\"html-classes\"]\n        except TypeError:\n            return \"\"\n        else:\n            if tag in html_classes_from_tag:\n                return ' class=\"%s\"' % html_classes_from_tag[tag]\n        return \"\"\n\n    def _do_code_blocks(self, text):\n        \"\"\"Process Markdown `<pre><code>` blocks.\"\"\"\n        code_block_re = re.compile(r'''\n            (?:\\n\\n|\\A\\n?)\n            (               # $1 = the code block -- one or more lines, starting with a space/tab\n              (?:\n                (?:[ ]{%d} | \\t)  # Lines must start with a tab or a tab-width of spaces\n                .*\\n+\n              )+\n            )\n            ((?=^[ ]{0,%d}\\S)|\\Z)   # Lookahead for non-space at line-start, or end of doc\n            ''' % (self.tab_width, self.tab_width),\n            re.M | re.X)\n        return code_block_re.sub(self._code_block_sub, text)\n\n    _fenced_code_block_re = re.compile(r'''\n        (?:\\n\\n|\\A\\n?)\n        ^```([\\w+-]+)?[ \\t]*\\n      # opening fence, $1 = optional lang\n        (.*?)                       # $2 = code block content\n        ^```[ \\t]*\\n                # closing fence\n        ''', re.M | re.X | re.S)\n\n    def _fenced_code_block_sub(self, match):\n        return self._code_block_sub(match, is_fenced_code_block=True);\n\n    def _do_fenced_code_blocks(self, text):\n        \"\"\"Process ```-fenced unindented code blocks ('fenced-code-blocks' extra).\"\"\"\n        return self._fenced_code_block_re.sub(self._fenced_code_block_sub, text)\n\n    # Rules for a code span:\n    # - backslash escapes are not interpreted in a code span\n    # - to include one or or a run of more backticks the delimiters must\n    #   be a longer run of backticks\n    # - cannot start or end a code span with a backtick; pad with a\n    #   space and that space will be removed in the emitted HTML\n    # See `test/tm-cases/escapes.text` for a number of edge-case\n    # examples.\n    _code_span_re = re.compile(r'''\n            (?<!\\\\)\n            (`+)        # \\1 = Opening run of `\n            (?!`)       # See Note A test/tm-cases/escapes.text\n            (.+?)       # \\2 = The code block\n            (?<!`)\n            \\1          # Matching closer\n            (?!`)\n        ''', re.X | re.S)\n\n    def _code_span_sub(self, match):\n        c = match.group(2).strip(\" \\t\")\n        c = self._encode_code(c)\n        return \"<code>%s</code>\" % c\n\n    def _do_code_spans(self, text):\n        #   *   Backtick quotes are used for <code></code> spans.\n        #\n        #   *   You can use multiple backticks as the delimiters if you want to\n        #       include literal backticks in the code span. So, this input:\n        #\n        #         Just type ``foo `bar` baz`` at the prompt.\n        #\n        #       Will translate to:\n        #\n        #         <p>Just type <code>foo `bar` baz</code> at the prompt.</p>\n        #\n        #       There's no arbitrary limit to the number of backticks you\n        #       can use as delimters. If you need three consecutive backticks\n        #       in your code, use four for delimiters, etc.\n        #\n        #   *   You can use spaces to get literal backticks at the edges:\n        #\n        #         ... type `` `bar` `` ...\n        #\n        #       Turns to:\n        #\n        #         ... type <code>`bar`</code> ...\n        return self._code_span_re.sub(self._code_span_sub, text)\n\n    def _encode_code(self, text):\n        \"\"\"Encode/escape certain characters inside Markdown code runs.\n        The point is that in code, these characters are literals,\n        and lose their special Markdown meanings.\n        \"\"\"\n        replacements = [\n            # Encode all ampersands; HTML entities are not\n            # entities within a Markdown code span.\n            ('&', '&amp;'),\n            # Do the angle bracket song and dance:\n            ('<', '&lt;'),\n            ('>', '&gt;'),\n        ]\n        for before, after in replacements:\n            text = text.replace(before, after)\n        hashed = _hash_text(text)\n        self._escape_table[text] = hashed\n        return hashed\n\n    _strong_re = re.compile(r\"(\\*\\*|__)(?=\\S)(.+?[*_]*)(?<=\\S)\\1\", re.S)\n    _em_re = re.compile(r\"(\\*|_)(?=\\S)(.+?)(?<=\\S)\\1\", re.S)\n    _code_friendly_strong_re = re.compile(r\"\\*\\*(?=\\S)(.+?[*_]*)(?<=\\S)\\*\\*\", re.S)\n    _code_friendly_em_re = re.compile(r\"\\*(?=\\S)(.+?)(?<=\\S)\\*\", re.S)\n    def _do_italics_and_bold(self, text):\n        # <strong> must go first:\n        if \"code-friendly\" in self.extras:\n            text = self._code_friendly_strong_re.sub(r\"<strong>\\1</strong>\", text)\n            text = self._code_friendly_em_re.sub(r\"<em>\\1</em>\", text)\n        else:\n            text = self._strong_re.sub(r\"<strong>\\2</strong>\", text)\n            text = self._em_re.sub(r\"<em>\\2</em>\", text)\n        return text\n\n    # \"smarty-pants\" extra: Very liberal in interpreting a single prime as an\n    # apostrophe; e.g. ignores the fact that \"round\", \"bout\", \"twer\", and\n    # \"twixt\" can be written without an initial apostrophe. This is fine because\n    # using scare quotes (single quotation marks) is rare.\n    _apostrophe_year_re = re.compile(r\"'(\\d\\d)(?=(\\s|,|;|\\.|\\?|!|$))\")\n    _contractions = [\"tis\", \"twas\", \"twer\", \"neath\", \"o\", \"n\",\n        \"round\", \"bout\", \"twixt\", \"nuff\", \"fraid\", \"sup\"]\n    def _do_smart_contractions(self, text):\n        text = self._apostrophe_year_re.sub(r\"&#8217;\\1\", text)\n        for c in self._contractions:\n            text = text.replace(\"'%s\" % c, \"&#8217;%s\" % c)\n            text = text.replace(\"'%s\" % c.capitalize(),\n                \"&#8217;%s\" % c.capitalize())\n        return text\n\n    # Substitute double-quotes before single-quotes.\n    _opening_single_quote_re = re.compile(r\"(?<!\\S)'(?=\\S)\")\n    _opening_double_quote_re = re.compile(r'(?<!\\S)\"(?=\\S)')\n    _closing_single_quote_re = re.compile(r\"(?<=\\S)'\")\n    _closing_double_quote_re = re.compile(r'(?<=\\S)\"(?=(\\s|,|;|\\.|\\?|!|$))')\n    def _do_smart_punctuation(self, text):\n        \"\"\"Fancifies 'single quotes', \"double quotes\", and apostrophes.\n        Converts --, ---, and ... into en dashes, em dashes, and ellipses.\n\n        Inspiration is: <http://daringfireball.net/projects/smartypants/>\n        See \"test/tm-cases/smarty_pants.text\" for a full discussion of the\n        support here and\n        <http://code.google.com/p/python-markdown2/issues/detail?id=42> for a\n        discussion of some diversion from the original SmartyPants.\n        \"\"\"\n        if \"'\" in text: # guard for perf\n            text = self._do_smart_contractions(text)\n            text = self._opening_single_quote_re.sub(\"&#8216;\", text)\n            text = self._closing_single_quote_re.sub(\"&#8217;\", text)\n\n        if '\"' in text: # guard for perf\n            text = self._opening_double_quote_re.sub(\"&#8220;\", text)\n            text = self._closing_double_quote_re.sub(\"&#8221;\", text)\n\n        text = text.replace(\"---\", \"&#8212;\")\n        text = text.replace(\"--\", \"&#8211;\")\n        text = text.replace(\"...\", \"&#8230;\")\n        text = text.replace(\" . . . \", \"&#8230;\")\n        text = text.replace(\". . .\", \"&#8230;\")\n        return text\n\n    _block_quote_re = re.compile(r'''\n        (                           # Wrap whole match in \\1\n          (\n            ^[ \\t]*>[ \\t]?          # '>' at the start of a line\n              .+\\n                  # rest of the first line\n            (.+\\n)*                 # subsequent consecutive lines\n            \\n*                     # blanks\n          )+\n        )\n        ''', re.M | re.X)\n    _bq_one_level_re = re.compile('^[ \\t]*>[ \\t]?', re.M);\n\n    _html_pre_block_re = re.compile(r'(\\s*<pre>.+?</pre>)', re.S)\n    def _dedent_two_spaces_sub(self, match):\n        return re.sub(r'(?m)^  ', '', match.group(1))\n\n    def _block_quote_sub(self, match):\n        bq = match.group(1)\n        bq = self._bq_one_level_re.sub('', bq)  # trim one level of quoting\n        bq = self._ws_only_line_re.sub('', bq)  # trim whitespace-only lines\n        bq = self._run_block_gamut(bq)          # recurse\n\n        bq = re.sub('(?m)^', '  ', bq)\n        # These leading spaces screw with <pre> content, so we need to fix that:\n        bq = self._html_pre_block_re.sub(self._dedent_two_spaces_sub, bq)\n\n        return \"<blockquote>\\n%s\\n</blockquote>\\n\\n\" % bq\n\n    def _do_block_quotes(self, text):\n        if '>' not in text:\n            return text\n        return self._block_quote_re.sub(self._block_quote_sub, text)\n\n    def _form_paragraphs(self, text):\n        # Strip leading and trailing lines:\n        text = text.strip('\\n')\n\n        # Wrap <p> tags.\n        grafs = []\n        for i, graf in enumerate(re.split(r\"\\n{2,}\", text)):\n            if graf in self.html_blocks:\n                # Unhashify HTML blocks\n                grafs.append(self.html_blocks[graf])\n            else:\n                cuddled_list = None\n                if \"cuddled-lists\" in self.extras:\n                    # Need to put back trailing '\\n' for `_list_item_re`\n                    # match at the end of the paragraph.\n                    li = self._list_item_re.search(graf + '\\n')\n                    # Two of the same list marker in this paragraph: a likely\n                    # candidate for a list cuddled to preceding paragraph\n                    # text (issue 33). Note the `[-1]` is a quick way to\n                    # consider numeric bullets (e.g. \"1.\" and \"2.\") to be\n                    # equal.\n                    if (li and len(li.group(2)) <= 3 and li.group(\"next_marker\")\n                        and li.group(\"marker\")[-1] == li.group(\"next_marker\")[-1]):\n                        start = li.start()\n                        cuddled_list = self._do_lists(graf[start:]).rstrip(\"\\n\")\n                        assert cuddled_list.startswith(\"<ul>\") or cuddled_list.startswith(\"<ol>\")\n                        graf = graf[:start]\n\n                # Wrap <p> tags.\n                graf = self._run_span_gamut(graf)\n                grafs.append(\"<p>\" + graf.lstrip(\" \\t\") + \"</p>\")\n\n                if cuddled_list:\n                    grafs.append(cuddled_list)\n\n        return \"\\n\\n\".join(grafs)\n\n    def _add_footnotes(self, text):\n        if self.footnotes:\n            footer = [\n                '<div class=\"footnotes\">',\n                '<hr' + self.empty_element_suffix,\n                '<ol>',\n            ]\n            for i, id in enumerate(self.footnote_ids):\n                if i != 0:\n                    footer.append('')\n                footer.append('<li id=\"fn-%s\">' % id)\n                footer.append(self._run_block_gamut(self.footnotes[id]))\n                backlink = ('<a href=\"#fnref-%s\" '\n                    'class=\"footnoteBackLink\" '\n                    'title=\"Jump back to footnote %d in the text.\">'\n                    '&#8617;</a>' % (id, i+1))\n                if footer[-1].endswith(\"</p>\"):\n                    footer[-1] = footer[-1][:-len(\"</p>\")] \\\n                        + '&nbsp;' + backlink + \"</p>\"\n                else:\n                    footer.append(\"\\n<p>%s</p>\" % backlink)\n                footer.append('</li>')\n            footer.append('</ol>')\n            footer.append('</div>')\n            return text + '\\n\\n' + '\\n'.join(footer)\n        else:\n            return text\n\n    # Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:\n    #   http://bumppo.net/projects/amputator/\n    _ampersand_re = re.compile(r'&(?!#?[xX]?(?:[0-9a-fA-F]+|\\w+);)')\n    _naked_lt_re = re.compile(r'<(?![a-z/?\\$!])', re.I)\n    _naked_gt_re = re.compile(r'''(?<![a-z0-9?!/'\"-])>''', re.I)\n\n    def _encode_amps_and_angles(self, text):\n        # Smart processing for ampersands and angle brackets that need\n        # to be encoded.\n        text = self._ampersand_re.sub('&amp;', text)\n\n        # Encode naked <'s\n        text = self._naked_lt_re.sub('&lt;', text)\n\n        # Encode naked >'s\n        # Note: Other markdown implementations (e.g. Markdown.pl, PHP\n        # Markdown) don't do this.\n        text = self._naked_gt_re.sub('&gt;', text)\n        return text\n\n    def _encode_backslash_escapes(self, text):\n        for ch, escape in list(self._escape_table.items()):\n            text = text.replace(\"\\\\\"+ch, escape)\n        return text\n\n    _auto_link_re = re.compile(r'<((https?|ftp):[^\\'\">\\s]+)>', re.I)\n    def _auto_link_sub(self, match):\n        g1 = match.group(1)\n        return '<a href=\"%s\">%s</a>' % (g1, g1)\n\n    _auto_email_link_re = re.compile(r\"\"\"\n          <\n           (?:mailto:)?\n          (\n              [-.\\w]+\n              \\@\n              [-\\w]+(\\.[-\\w]+)*\\.[a-z]+\n          )\n          >\n        \"\"\", re.I | re.X | re.U)\n    def _auto_email_link_sub(self, match):\n        return self._encode_email_address(\n            self._unescape_special_chars(match.group(1)))\n\n    def _do_auto_links(self, text):\n        text = self._auto_link_re.sub(self._auto_link_sub, text)\n        text = self._auto_email_link_re.sub(self._auto_email_link_sub, text)\n        return text\n\n    def _encode_email_address(self, addr):\n        #  Input: an email address, e.g. \"foo@example.com\"\n        #\n        #  Output: the email address as a mailto link, with each character\n        #      of the address encoded as either a decimal or hex entity, in\n        #      the hopes of foiling most address harvesting spam bots. E.g.:\n        #\n        #    <a href=\"&#x6D;&#97;&#105;&#108;&#x74;&#111;:&#102;&#111;&#111;&#64;&#101;\n        #       x&#x61;&#109;&#x70;&#108;&#x65;&#x2E;&#99;&#111;&#109;\">&#102;&#111;&#111;\n        #       &#64;&#101;x&#x61;&#109;&#x70;&#108;&#x65;&#x2E;&#99;&#111;&#109;</a>\n        #\n        #  Based on a filter by Matthew Wickline, posted to the BBEdit-Talk\n        #  mailing list: <http://tinyurl.com/yu7ue>\n        chars = [_xml_encode_email_char_at_random(ch)\n                 for ch in \"mailto:\" + addr]\n        # Strip the mailto: from the visible part.\n        addr = '<a href=\"%s\">%s</a>' \\\n               % (''.join(chars), ''.join(chars[7:]))\n        return addr\n\n    def _do_link_patterns(self, text):\n        \"\"\"Caveat emptor: there isn't much guarding against link\n        patterns being formed inside other standard Markdown links, e.g.\n        inside a [link def][like this].\n\n        Dev Notes: *Could* consider prefixing regexes with a negative\n        lookbehind assertion to attempt to guard against this.\n        \"\"\"\n        link_from_hash = {}\n        for regex, repl in self.link_patterns:\n            replacements = []\n            for match in regex.finditer(text):\n                if hasattr(repl, \"__call__\"):\n                    href = repl(match)\n                else:\n                    href = match.expand(repl)\n                replacements.append((match.span(), href))\n            for (start, end), href in reversed(replacements):\n                escaped_href = (\n                    href.replace('\"', '&quot;')  # b/c of attr quote\n                        # To avoid markdown <em> and <strong>:\n                        .replace('*', self._escape_table['*'])\n                        .replace('_', self._escape_table['_']))\n                link = '<a href=\"%s\">%s</a>' % (escaped_href, text[start:end])\n                hash = _hash_text(link)\n                link_from_hash[hash] = link\n                text = text[:start] + hash + text[end:]\n        for hash, link in list(link_from_hash.items()):\n            text = text.replace(hash, link)\n        return text\n\n    def _unescape_special_chars(self, text):\n        # Swap back in all the special characters we've hidden.\n        for ch, hash in list(self._escape_table.items()):\n            text = text.replace(hash, ch)\n        return text\n\n    def _outdent(self, text):\n        # Remove one level of line-leading tabs or spaces\n        return self._outdent_re.sub('', text)\n\n\nclass MarkdownWithExtras(Markdown):\n    \"\"\"A markdowner class that enables most extras:\n\n    - footnotes\n    - code-color (only has effect if 'pygments' Python module on path)\n\n    These are not included:\n    - pyshell (specific to Python-related documenting)\n    - code-friendly (because it *disables* part of the syntax)\n    - link-patterns (because you need to specify some actual\n      link-patterns anyway)\n    \"\"\"\n    extras = [\"footnotes\", \"code-color\"]\n\n\n#---- internal support functions\n\nclass UnicodeWithAttrs(unicode):\n    \"\"\"A subclass of unicode used for the return value of conversion to\n    possibly attach some attributes. E.g. the \"toc_html\" attribute when\n    the \"toc\" extra is used.\n    \"\"\"\n    metadata = None\n    _toc = None\n    def toc_html(self):\n        \"\"\"Return the HTML for the current TOC.\n\n        This expects the `_toc` attribute to have been set on this instance.\n        \"\"\"\n        if self._toc is None:\n            return None\n\n        def indent():\n            return '  ' * (len(h_stack) - 1)\n        lines = []\n        h_stack = [0]   # stack of header-level numbers\n        for level, id, name in self._toc:\n            if level > h_stack[-1]:\n                lines.append(\"%s<ul>\" % indent())\n                h_stack.append(level)\n            elif level == h_stack[-1]:\n                lines[-1] += \"</li>\"\n            else:\n                while level < h_stack[-1]:\n                    h_stack.pop()\n                    if not lines[-1].endswith(\"</li>\"):\n                        lines[-1] += \"</li>\"\n                    lines.append(\"%s</ul></li>\" % indent())\n            lines.append('%s<li><a href=\"#%s\">%s</a>' % (\n                indent(), id, name))\n        while len(h_stack) > 1:\n            h_stack.pop()\n            if not lines[-1].endswith(\"</li>\"):\n                lines[-1] += \"</li>\"\n            lines.append(\"%s</ul>\" % indent())\n        return '\\n'.join(lines) + '\\n'\n    toc_html = property(toc_html)\n\n## {{{ http://code.activestate.com/recipes/577257/ (r1)\n_slugify_strip_re = re.compile(r'[^\\w\\s-]')\n_slugify_hyphenate_re = re.compile(r'[-\\s]+')\ndef _slugify(value):\n    \"\"\"\n    Normalizes string, converts to lowercase, removes non-alpha characters,\n    and converts spaces to hyphens.\n\n    From Django's \"django/template/defaultfilters.py\".\n    \"\"\"\n    try:\n        import unicodedata\n        value = unicodedata.normalize('NFKD', value)\n    except ImportError:\n        pass\n    value = value.encode('ascii', 'ignore').decode()\n    value = _slugify_strip_re.sub('', value).strip().lower()\n    return _slugify_hyphenate_re.sub('-', value)\n## end of http://code.activestate.com/recipes/577257/ }}}\n\n\n# From http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52549\ndef _curry(*args, **kwargs):\n    function, args = args[0], args[1:]\n    def result(*rest, **kwrest):\n        combined = kwargs.copy()\n        combined.update(kwrest)\n        return function(*args + rest, **combined)\n    return result\n\n# Recipe: regex_from_encoded_pattern (1.0)\ndef _regex_from_encoded_pattern(s):\n    \"\"\"'foo'    -> re.compile(re.escape('foo'))\n       '/foo/'  -> re.compile('foo')\n       '/foo/i' -> re.compile('foo', re.I)\n    \"\"\"\n    if s.startswith('/') and s.rfind('/') != 0:\n        # Parse it: /PATTERN/FLAGS\n        idx = s.rfind('/')\n        pattern, flags_str = s[1:idx], s[idx+1:]\n        flag_from_char = {\n            \"i\": re.IGNORECASE,\n            \"l\": re.LOCALE,\n            \"s\": re.DOTALL,\n            \"m\": re.MULTILINE,\n            \"u\": re.UNICODE,\n        }\n        flags = 0\n        for char in flags_str:\n            try:\n                flags |= flag_from_char[char]\n            except KeyError:\n                raise ValueError(\"unsupported regex flag: '%s' in '%s' \"\n                                 \"(must be one of '%s')\"\n                                 % (char, s, ''.join(list(flag_from_char.keys()))))\n        return re.compile(s[1:idx], flags)\n    else: # not an encoded regex\n        return re.compile(re.escape(s))\n\n# Recipe: dedent (0.1.2)\ndef _dedentlines(lines, tabsize=8, skip_first_line=False):\n    \"\"\"_dedentlines(lines, tabsize=8, skip_first_line=False) -> dedented lines\n\n        \"lines\" is a list of lines to dedent.\n        \"tabsize\" is the tab width to use for indent width calculations.\n        \"skip_first_line\" is a boolean indicating if the first line should\n            be skipped for calculating the indent width and for dedenting.\n            This is sometimes useful for docstrings and similar.\n\n    Same as dedent() except operates on a sequence of lines. Note: the\n    lines list is modified **in-place**.\n    \"\"\"\n    DEBUG = False\n    if DEBUG:\n        print(\"dedent: dedent(..., tabsize=%d, skip_first_line=%r)\"\\\n              % (tabsize, skip_first_line))\n    indents = []\n    margin = None\n    for i, line in enumerate(lines):\n        if i == 0 and skip_first_line: continue\n        indent = 0\n        for ch in line:\n            if ch == ' ':\n                indent += 1\n            elif ch == '\\t':\n                indent += tabsize - (indent % tabsize)\n            elif ch in '\\r\\n':\n                continue # skip all-whitespace lines\n            else:\n                break\n        else:\n            continue # skip all-whitespace lines\n        if DEBUG: print(\"dedent: indent=%d: %r\" % (indent, line))\n        if margin is None:\n            margin = indent\n        else:\n            margin = min(margin, indent)\n    if DEBUG: print(\"dedent: margin=%r\" % margin)\n\n    if margin is not None and margin > 0:\n        for i, line in enumerate(lines):\n            if i == 0 and skip_first_line: continue\n            removed = 0\n            for j, ch in enumerate(line):\n                if ch == ' ':\n                    removed += 1\n                elif ch == '\\t':\n                    removed += tabsize - (removed % tabsize)\n                elif ch in '\\r\\n':\n                    if DEBUG: print(\"dedent: %r: EOL -> strip up to EOL\" % line)\n                    lines[i] = lines[i][j:]\n                    break\n                else:\n                    raise ValueError(\"unexpected non-whitespace char %r in \"\n                                     \"line %r while removing %d-space margin\"\n                                     % (ch, line, margin))\n                if DEBUG:\n                    print(\"dedent: %r: %r -> removed %d/%d\"\\\n                          % (line, ch, removed, margin))\n                if removed == margin:\n                    lines[i] = lines[i][j+1:]\n                    break\n                elif removed > margin:\n                    lines[i] = ' '*(removed-margin) + lines[i][j+1:]\n                    break\n            else:\n                if removed:\n                    lines[i] = lines[i][removed:]\n    return lines\n\ndef _dedent(text, tabsize=8, skip_first_line=False):\n    \"\"\"_dedent(text, tabsize=8, skip_first_line=False) -> dedented text\n\n        \"text\" is the text to dedent.\n        \"tabsize\" is the tab width to use for indent width calculations.\n        \"skip_first_line\" is a boolean indicating if the first line should\n            be skipped for calculating the indent width and for dedenting.\n            This is sometimes useful for docstrings and similar.\n\n    textwrap.dedent(s), but don't expand tabs to spaces\n    \"\"\"\n    lines = text.splitlines(1)\n    _dedentlines(lines, tabsize=tabsize, skip_first_line=skip_first_line)\n    return ''.join(lines)\n\n\nclass _memoized(object):\n   \"\"\"Decorator that caches a function's return value each time it is called.\n   If called later with the same arguments, the cached value is returned, and\n   not re-evaluated.\n\n   http://wiki.python.org/moin/PythonDecoratorLibrary\n   \"\"\"\n   def __init__(self, func):\n      self.func = func\n      self.cache = {}\n   def __call__(self, *args):\n      try:\n         return self.cache[args]\n      except KeyError:\n         self.cache[args] = value = self.func(*args)\n         return value\n      except TypeError:\n         # uncachable -- for instance, passing a list as an argument.\n         # Better to not cache than to blow up entirely.\n         return self.func(*args)\n   def __repr__(self):\n      \"\"\"Return the function's docstring.\"\"\"\n      return self.func.__doc__\n\n\ndef _xml_oneliner_re_from_tab_width(tab_width):\n    \"\"\"Standalone XML processing instruction regex.\"\"\"\n    return re.compile(r\"\"\"\n        (?:\n            (?<=\\n\\n)       # Starting after a blank line\n            |               # or\n            \\A\\n?           # the beginning of the doc\n        )\n        (                           # save in $1\n            [ ]{0,%d}\n            (?:\n                <\\?\\w+\\b\\s+.*?\\?>   # XML processing instruction\n                |\n                <\\w+:\\w+\\b\\s+.*?/>  # namespaced single tag\n            )\n            [ \\t]*\n            (?=\\n{2,}|\\Z)       # followed by a blank line or end of document\n        )\n        \"\"\" % (tab_width - 1), re.X)\n_xml_oneliner_re_from_tab_width = _memoized(_xml_oneliner_re_from_tab_width)\n\ndef _hr_tag_re_from_tab_width(tab_width):\n     return re.compile(r\"\"\"\n        (?:\n            (?<=\\n\\n)       # Starting after a blank line\n            |               # or\n            \\A\\n?           # the beginning of the doc\n        )\n        (                       # save in \\1\n            [ ]{0,%d}\n            <(hr)               # start tag = \\2\n            \\b                  # word break\n            ([^<>])*?           #\n            /?>                 # the matching end tag\n            [ \\t]*\n            (?=\\n{2,}|\\Z)       # followed by a blank line or end of document\n        )\n        \"\"\" % (tab_width - 1), re.X)\n_hr_tag_re_from_tab_width = _memoized(_hr_tag_re_from_tab_width)\n\n\ndef _xml_escape_attr(attr, skip_single_quote=True):\n    \"\"\"Escape the given string for use in an HTML/XML tag attribute.\n\n    By default this doesn't bother with escaping `'` to `&#39;`, presuming that\n    the tag attribute is surrounded by double quotes.\n    \"\"\"\n    escaped = (attr\n        .replace('&', '&amp;')\n        .replace('\"', '&quot;')\n        .replace('<', '&lt;')\n        .replace('>', '&gt;'))\n    if not skip_single_quote:\n        escaped = escaped.replace(\"'\", \"&#39;\")\n    return escaped\n\n\ndef _xml_encode_email_char_at_random(ch):\n    r = random()\n    # Roughly 10% raw, 45% hex, 45% dec.\n    # '@' *must* be encoded. I [John Gruber] insist.\n    # Issue 26: '_' must be encoded.\n    if r > 0.9 and ch not in \"@_\":\n        return ch\n    elif r < 0.45:\n        # The [1:] is to drop leading '0': 0x63 -> x63\n        return '&#%s;' % hex(ord(ch))[1:]\n    else:\n        return '&#%s;' % ord(ch)\n\n\n\n#---- mainline\n\nclass _NoReflowFormatter(optparse.IndentedHelpFormatter):\n    \"\"\"An optparse formatter that does NOT reflow the description.\"\"\"\n    def format_description(self, description):\n        return description or \"\"\n\ndef _test():\n    import doctest\n    doctest.testmod()\n\ndef main(argv=None):\n    if argv is None:\n        argv = sys.argv\n    if not logging.root.handlers:\n        logging.basicConfig()\n\n    usage = \"usage: %prog [PATHS...]\"\n    version = \"%prog \"+__version__\n    parser = optparse.OptionParser(prog=\"markdown2\", usage=usage,\n        version=version, description=cmdln_desc,\n        formatter=_NoReflowFormatter())\n    parser.add_option(\"-v\", \"--verbose\", dest=\"log_level\",\n                      action=\"store_const\", const=logging.DEBUG,\n                      help=\"more verbose output\")\n    parser.add_option(\"--encoding\",\n                      help=\"specify encoding of text content\")\n    parser.add_option(\"--html4tags\", action=\"store_true\", default=False,\n                      help=\"use HTML 4 style for empty element tags\")\n    parser.add_option(\"-s\", \"--safe\", metavar=\"MODE\", dest=\"safe_mode\",\n                      help=\"sanitize literal HTML: 'escape' escapes \"\n                           \"HTML meta chars, 'replace' replaces with an \"\n                           \"[HTML_REMOVED] note\")\n    parser.add_option(\"-x\", \"--extras\", action=\"append\",\n                      help=\"Turn on specific extra features (not part of \"\n                           \"the core Markdown spec). See above.\")\n    parser.add_option(\"--use-file-vars\",\n                      help=\"Look for and use Emacs-style 'markdown-extras' \"\n                           \"file var to turn on extras. See \"\n                           \"<https://github.com/trentm/python-markdown2/wiki/Extras>\")\n    parser.add_option(\"--link-patterns-file\",\n                      help=\"path to a link pattern file\")\n    parser.add_option(\"--self-test\", action=\"store_true\",\n                      help=\"run internal self-tests (some doctests)\")\n    parser.add_option(\"--compare\", action=\"store_true\",\n                      help=\"run against Markdown.pl as well (for testing)\")\n    parser.set_defaults(log_level=logging.INFO, compare=False,\n                        encoding=\"utf-8\", safe_mode=None, use_file_vars=False)\n    opts, paths = parser.parse_args()\n    log.setLevel(opts.log_level)\n\n    if opts.self_test:\n        return _test()\n\n    if opts.extras:\n        extras = {}\n        for s in opts.extras:\n            splitter = re.compile(\"[,;: ]+\")\n            for e in splitter.split(s):\n                if '=' in e:\n                    ename, earg = e.split('=', 1)\n                    try:\n                        earg = int(earg)\n                    except ValueError:\n                        pass\n                else:\n                    ename, earg = e, None\n                extras[ename] = earg\n    else:\n        extras = None\n\n    if opts.link_patterns_file:\n        link_patterns = []\n        f = open(opts.link_patterns_file)\n        try:\n            for i, line in enumerate(f.readlines()):\n                if not line.strip(): continue\n                if line.lstrip().startswith(\"#\"): continue\n                try:\n                    pat, href = line.rstrip().rsplit(None, 1)\n                except ValueError:\n                    raise MarkdownError(\"%s:%d: invalid link pattern line: %r\"\n                                        % (opts.link_patterns_file, i+1, line))\n                link_patterns.append(\n                    (_regex_from_encoded_pattern(pat), href))\n        finally:\n            f.close()\n    else:\n        link_patterns = None\n\n    from os.path import join, dirname, abspath, exists\n    markdown_pl = join(dirname(dirname(abspath(__file__))), \"test\",\n                       \"Markdown.pl\")\n    if not paths:\n        paths = ['-']\n    for path in paths:\n        if path == '-':\n            text = sys.stdin.read()\n        else:\n            fp = codecs.open(path, 'r', opts.encoding)\n            text = fp.read()\n            fp.close()\n        if opts.compare:\n            from subprocess import Popen, PIPE\n            print(\"==== Markdown.pl ====\")\n            p = Popen('perl %s' % markdown_pl, shell=True, stdin=PIPE, stdout=PIPE, close_fds=True)\n            p.stdin.write(text.encode('utf-8'))\n            p.stdin.close()\n            perl_html = p.stdout.read().decode('utf-8')\n            if py3:\n                sys.stdout.write(perl_html)\n            else:\n                sys.stdout.write(perl_html.encode(\n                    sys.stdout.encoding or \"utf-8\", 'xmlcharrefreplace'))\n            print(\"==== markdown2.py ====\")\n        html = markdown(text,\n            html4tags=opts.html4tags,\n            safe_mode=opts.safe_mode,\n            extras=extras, link_patterns=link_patterns,\n            use_file_vars=opts.use_file_vars)\n        if py3:\n            sys.stdout.write(html)\n        else:\n            sys.stdout.write(html.encode(\n                sys.stdout.encoding or \"utf-8\", 'xmlcharrefreplace'))\n        if extras and \"toc\" in extras:\n            log.debug(\"toc_html: \" +\n                html.toc_html.encode(sys.stdout.encoding or \"utf-8\", 'xmlcharrefreplace'))\n        if opts.compare:\n            test_dir = join(dirname(dirname(abspath(__file__))), \"test\")\n            if exists(join(test_dir, \"test_markdown2.py\")):\n                sys.path.insert(0, test_dir)\n                from test_markdown2 import norm_html_from_html\n                norm_html = norm_html_from_html(html)\n                norm_perl_html = norm_html_from_html(perl_html)\n            else:\n                norm_html = html\n                norm_perl_html = perl_html\n            print(\"==== match? %r ====\" % (norm_perl_html == norm_html))\n\n\nif __name__ == \"__main__\":\n    sys.exit( main(sys.argv) )\n"
  },
  {
    "path": "lib/oauth2/__init__.py",
    "content": "\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\"\"\"\n\nimport base64\nimport urllib\nimport time\nimport random\nimport urlparse\nimport hmac\nimport binascii\nimport httplib2\n\ntry:\n    from urlparse import parse_qs\n    parse_qs # placate pyflakes\nexcept ImportError:\n    # fall back for Python 2.5\n    from cgi import parse_qs\n\ntry:\n    from hashlib import sha1\n    sha = sha1\nexcept ImportError:\n    # hashlib was added in Python 2.5\n    import sha\n\n# import _version\n\n# __version__ = _version.__version__\n\nOAUTH_VERSION = '1.0'  # Hi Blaine!\nHTTP_METHOD = 'GET'\nSIGNATURE_METHOD = 'PLAINTEXT'\n\n\nclass Error(RuntimeError):\n    \"\"\"Generic exception class.\"\"\"\n\n    def __init__(self, message='OAuth error occurred.'):\n        self._message = message\n\n    @property\n    def message(self):\n        \"\"\"A hack to get around the deprecation errors in 2.6.\"\"\"\n        return self._message\n\n    def __str__(self):\n        return self._message\n\n\nclass MissingSignature(Error):\n    pass\n\n\ndef build_authenticate_header(realm=''):\n    \"\"\"Optional WWW-Authenticate header (401 error)\"\"\"\n    return {'WWW-Authenticate': 'OAuth realm=\"%s\"' % realm}\n\n\ndef build_xoauth_string(url, consumer, token=None):\n    \"\"\"Build an XOAUTH string for use in SMTP/IMPA authentication.\"\"\"\n    request = Request.from_consumer_and_token(consumer, token,\n        \"GET\", url)\n\n    signing_method = SignatureMethod_HMAC_SHA1()\n    request.sign_request(signing_method, consumer, token)\n\n    params = []\n    for k, v in sorted(request.iteritems()):\n        if v is not None:\n            params.append('%s=\"%s\"' % (k, escape(v)))\n\n    return \"%s %s %s\" % (\"GET\", url, ','.join(params))\n\n\ndef to_unicode(s):\n    \"\"\" Convert to unicode, raise exception with instructive error\n    message if s is not unicode, ascii, or utf-8. \"\"\"\n    if not isinstance(s, unicode):\n        if not isinstance(s, str):\n            raise TypeError('You are required to pass either unicode or string here, not: %r (%s)' % (type(s), s))\n        try:\n            s = s.decode('utf-8')\n        except UnicodeDecodeError, le:\n            raise TypeError('You are required to pass either a unicode object or a utf-8 string here. You passed a Python string object which contained non-utf-8: %r. The UnicodeDecodeError that resulted from attempting to interpret it as utf-8 was: %s' % (s, le,))\n    return s\n\ndef to_utf8(s):\n    return to_unicode(s).encode('utf-8')\n\ndef to_unicode_if_string(s):\n    if isinstance(s, basestring):\n        return to_unicode(s)\n    else:\n        return s\n\ndef to_utf8_if_string(s):\n    if isinstance(s, basestring):\n        return to_utf8(s)\n    else:\n        return s\n\ndef to_unicode_optional_iterator(x):\n    \"\"\"\n    Raise TypeError if x is a str containing non-utf8 bytes or if x is\n    an iterable which contains such a str.\n    \"\"\"\n    if isinstance(x, basestring):\n        return to_unicode(x)\n\n    try:\n        l = list(x)\n    except TypeError, e:\n        assert 'is not iterable' in str(e)\n        return x\n    else:\n        return [ to_unicode(e) for e in l ]\n\ndef to_utf8_optional_iterator(x):\n    \"\"\"\n    Raise TypeError if x is a str or if x is an iterable which\n    contains a str.\n    \"\"\"\n    if isinstance(x, basestring):\n        return to_utf8(x)\n\n    try:\n        l = list(x)\n    except TypeError, e:\n        assert 'is not iterable' in str(e)\n        return x\n    else:\n        return [ to_utf8_if_string(e) for e in l ]\n\ndef escape(s):\n    \"\"\"Escape a URL including any /.\"\"\"\n    return urllib.quote(s.encode('utf-8'), safe='~')\n\ndef generate_timestamp():\n    \"\"\"Get seconds since epoch (UTC).\"\"\"\n    return int(time.time())\n\n\ndef generate_nonce(length=8):\n    \"\"\"Generate pseudorandom number.\"\"\"\n    return ''.join([str(random.randint(0, 9)) for i in range(length)])\n\n\ndef generate_verifier(length=8):\n    \"\"\"Generate pseudorandom number.\"\"\"\n    return ''.join([str(random.randint(0, 9)) for i in range(length)])\n\n\nclass Consumer(object):\n    \"\"\"A consumer of OAuth-protected services.\n \n    The OAuth consumer is a \"third-party\" service that wants to access\n    protected resources from an OAuth service provider on behalf of an end\n    user. It's kind of the OAuth client.\n \n    Usually a consumer must be registered with the service provider by the\n    developer of the consumer software. As part of that process, the service\n    provider gives the consumer a *key* and a *secret* with which the consumer\n    software can identify itself to the service. The consumer will include its\n    key in each request to identify itself, but will use its secret only when\n    signing requests, to prove that the request is from that particular\n    registered consumer.\n \n    Once registered, the consumer can then use its consumer credentials to ask\n    the service provider for a request token, kicking off the OAuth\n    authorization process.\n    \"\"\"\n\n    key = None\n    secret = None\n\n    def __init__(self, key, secret):\n        self.key = key\n        self.secret = secret\n\n        if self.key is None or self.secret is None:\n            raise ValueError(\"Key and secret must be set.\")\n\n    def __str__(self):\n        data = {'oauth_consumer_key': self.key,\n            'oauth_consumer_secret': self.secret}\n\n        return urllib.urlencode(data)\n\n\nclass Token(object):\n    \"\"\"An OAuth credential used to request authorization or a protected\n    resource.\n \n    Tokens in OAuth comprise a *key* and a *secret*. The key is included in\n    requests to identify the token being used, but the secret is used only in\n    the signature, to prove that the requester is who the server gave the\n    token to.\n \n    When first negotiating the authorization, the consumer asks for a *request\n    token* that the live user authorizes with the service provider. The\n    consumer then exchanges the request token for an *access token* that can\n    be used to access protected resources.\n    \"\"\"\n\n    key = None\n    secret = None\n    callback = None\n    callback_confirmed = None\n    verifier = None\n\n    def __init__(self, key, secret):\n        self.key = key\n        self.secret = secret\n\n        if self.key is None or self.secret is None:\n            raise ValueError(\"Key and secret must be set.\")\n\n    def set_callback(self, callback):\n        self.callback = callback\n        self.callback_confirmed = 'true'\n\n    def set_verifier(self, verifier=None):\n        if verifier is not None:\n            self.verifier = verifier\n        else:\n            self.verifier = generate_verifier()\n\n    def get_callback_url(self):\n        if self.callback and self.verifier:\n            # Append the oauth_verifier.\n            parts = urlparse.urlparse(self.callback)\n            scheme, netloc, path, params, query, fragment = parts[:6]\n            if query:\n                query = '%s&oauth_verifier=%s' % (query, self.verifier)\n            else:\n                query = 'oauth_verifier=%s' % self.verifier\n            return urlparse.urlunparse((scheme, netloc, path, params,\n                query, fragment))\n        return self.callback\n\n    def to_string(self):\n        \"\"\"Returns this token as a plain string, suitable for storage.\n \n        The resulting string includes the token's secret, so you should never\n        send or store this string where a third party can read it.\n        \"\"\"\n\n        data = {\n            'oauth_token': self.key,\n            'oauth_token_secret': self.secret,\n        }\n\n        if self.callback_confirmed is not None:\n            data['oauth_callback_confirmed'] = self.callback_confirmed\n        return urllib.urlencode(data)\n \n    @staticmethod\n    def from_string(s):\n        \"\"\"Deserializes a token from a string like one returned by\n        `to_string()`.\"\"\"\n\n        if not len(s):\n            raise ValueError(\"Invalid parameter string.\")\n\n        params = parse_qs(s, keep_blank_values=False)\n        if not len(params):\n            raise ValueError(\"Invalid parameter string.\")\n\n        try:\n            key = params['oauth_token'][0]\n        except Exception:\n            raise ValueError(\"'oauth_token' not found in OAuth request.\")\n\n        try:\n            secret = params['oauth_token_secret'][0]\n        except Exception:\n            raise ValueError(\"'oauth_token_secret' not found in \" \n                \"OAuth request.\")\n\n        token = Token(key, secret)\n        try:\n            token.callback_confirmed = params['oauth_callback_confirmed'][0]\n        except KeyError:\n            pass  # 1.0, no callback confirmed.\n        return token\n\n    def __str__(self):\n        return self.to_string()\n\n\ndef setter(attr):\n    name = attr.__name__\n \n    def getter(self):\n        try:\n            return self.__dict__[name]\n        except KeyError:\n            raise AttributeError(name)\n \n    def deleter(self):\n        del self.__dict__[name]\n \n    return property(getter, attr, deleter)\n\n\nclass Request(dict):\n \n    \"\"\"The parameters and information for an HTTP request, suitable for\n    authorizing with OAuth credentials.\n \n    When a consumer wants to access a service's protected resources, it does\n    so using a signed HTTP request identifying itself (the consumer) with its\n    key, and providing an access token authorized by the end user to access\n    those resources.\n \n    \"\"\"\n \n    version = OAUTH_VERSION\n\n    def __init__(self, method=HTTP_METHOD, url=None, parameters=None,\n                 body='', is_form_encoded=False):\n        if url is not None:\n            self.url = to_unicode(url)\n        self.method = method\n        if parameters is not None:\n            for k, v in parameters.iteritems():\n                k = to_unicode(k)\n                v = to_unicode_optional_iterator(v)\n                self[k] = v\n        self.body = body\n        self.is_form_encoded = is_form_encoded\n\n\n    @setter\n    def url(self, value):\n        self.__dict__['url'] = value\n        if value is not None:\n            scheme, netloc, path, params, query, fragment = urlparse.urlparse(value)\n\n            # Exclude default port numbers.\n            if scheme == 'http' and netloc[-3:] == ':80':\n                netloc = netloc[:-3]\n            elif scheme == 'https' and netloc[-4:] == ':443':\n                netloc = netloc[:-4]\n            if scheme not in ('http', 'https'):\n                raise ValueError(\"Unsupported URL %s (%s).\" % (value, scheme))\n\n            # Normalized URL excludes params, query, and fragment.\n            self.normalized_url = urlparse.urlunparse((scheme, netloc, path, None, None, None))\n        else:\n            self.normalized_url = None\n            self.__dict__['url'] = None\n \n    @setter\n    def method(self, value):\n        self.__dict__['method'] = value.upper()\n \n    def _get_timestamp_nonce(self):\n        return self['oauth_timestamp'], self['oauth_nonce']\n \n    def get_nonoauth_parameters(self):\n        \"\"\"Get any non-OAuth parameters.\"\"\"\n        return dict([(k, v) for k, v in self.iteritems() \n                    if not k.startswith('oauth_')])\n \n    def to_header(self, realm=''):\n        \"\"\"Serialize as a header for an HTTPAuth request.\"\"\"\n        oauth_params = ((k, v) for k, v in self.items() \n                            if k.startswith('oauth_'))\n        stringy_params = ((k, escape(str(v))) for k, v in oauth_params)\n        header_params = ('%s=\"%s\"' % (k, v) for k, v in stringy_params)\n        params_header = ', '.join(header_params)\n \n        auth_header = 'OAuth realm=\"%s\"' % realm\n        if params_header:\n            auth_header = \"%s, %s\" % (auth_header, params_header)\n \n        return {'Authorization': auth_header}\n \n    def to_postdata(self):\n        \"\"\"Serialize as post data for a POST request.\"\"\"\n        d = {}\n        for k, v in self.iteritems():\n            d[k.encode('utf-8')] = to_utf8_optional_iterator(v)\n\n        # tell urlencode to deal with sequence values and map them correctly\n        # to resulting querystring. for example self[\"k\"] = [\"v1\", \"v2\"] will\n        # result in 'k=v1&k=v2' and not k=%5B%27v1%27%2C+%27v2%27%5D\n        return urllib.urlencode(d, True).replace('+', '%20')\n \n    def to_url(self):\n        \"\"\"Serialize as a URL for a GET request.\"\"\"\n        base_url = urlparse.urlparse(self.url)\n        try:\n            query = base_url.query\n        except AttributeError:\n            # must be python <2.5\n            query = base_url[4]\n        query = parse_qs(query)\n        for k, v in self.items():\n            query.setdefault(k, []).append(v)\n        \n        try:\n            scheme = base_url.scheme\n            netloc = base_url.netloc\n            path = base_url.path\n            params = base_url.params\n            fragment = base_url.fragment\n        except AttributeError:\n            # must be python <2.5\n            scheme = base_url[0]\n            netloc = base_url[1]\n            path = base_url[2]\n            params = base_url[3]\n            fragment = base_url[5]\n        \n        url = (scheme, netloc, path, params,\n               urllib.urlencode(query, True), fragment)\n        return urlparse.urlunparse(url)\n\n    def get_parameter(self, parameter):\n        ret = self.get(parameter)\n        if ret is None:\n            raise Error('Parameter not found: %s' % parameter)\n\n        return ret\n\n    def get_normalized_parameters(self):\n        \"\"\"Return a string that contains the parameters that must be signed.\"\"\"\n        items = []\n        for key, value in self.iteritems():\n            if key == 'oauth_signature':\n                continue\n            # 1.0a/9.1.1 states that kvp must be sorted by key, then by value,\n            # so we unpack sequence values into multiple items for sorting.\n            if isinstance(value, basestring):\n                items.append((to_utf8_if_string(key), to_utf8(value)))\n            else:\n                try:\n                    value = list(value)\n                except TypeError, e:\n                    assert 'is not iterable' in str(e)\n                    items.append((to_utf8_if_string(key), to_utf8_if_string(value)))\n                else:\n                    items.extend((to_utf8_if_string(key), to_utf8_if_string(item)) for item in value)\n\n        # Include any query string parameters from the provided URL\n        query = urlparse.urlparse(self.url)[4]\n\n        url_items = self._split_url_string(query).items()\n        url_items = [(to_utf8(k), to_utf8(v)) for k, v in url_items if k != 'oauth_signature' ]\n        items.extend(url_items)\n\n        items.sort()\n        encoded_str = urllib.urlencode(items)\n        # Encode signature parameters per Oauth Core 1.0 protocol\n        # spec draft 7, section 3.6\n        # (http://tools.ietf.org/html/draft-hammer-oauth-07#section-3.6)\n        # Spaces must be encoded with \"%20\" instead of \"+\"\n        return encoded_str.replace('+', '%20').replace('%7E', '~')\n\n    def sign_request(self, signature_method, consumer, token):\n        \"\"\"Set the signature parameter to the result of sign.\"\"\"\n\n        if not self.is_form_encoded:\n            # according to\n            # http://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html\n            # section 4.1.1 \"OAuth Consumers MUST NOT include an\n            # oauth_body_hash parameter on requests with form-encoded\n            # request bodies.\"\n            self['oauth_body_hash'] = base64.b64encode(sha(self.body).digest())\n\n        if 'oauth_consumer_key' not in self:\n            self['oauth_consumer_key'] = consumer.key\n\n        if token and 'oauth_token' not in self:\n            self['oauth_token'] = token.key\n\n        self['oauth_signature_method'] = signature_method.name\n        self['oauth_signature'] = signature_method.sign(self, consumer, token)\n \n    @classmethod\n    def make_timestamp(cls):\n        \"\"\"Get seconds since epoch (UTC).\"\"\"\n        return str(int(time.time()))\n \n    @classmethod\n    def make_nonce(cls):\n        \"\"\"Generate pseudorandom number.\"\"\"\n        return str(random.randint(0, 100000000))\n \n    @classmethod\n    def from_request(cls, http_method, http_url, headers=None, parameters=None,\n            query_string=None):\n        \"\"\"Combines multiple parameter sources.\"\"\"\n        if parameters is None:\n            parameters = {}\n \n        # Headers\n        if headers and 'Authorization' in headers:\n            auth_header = headers['Authorization']\n            # Check that the authorization header is OAuth.\n            if auth_header[:6] == 'OAuth ':\n                auth_header = auth_header[6:]\n                try:\n                    # Get the parameters from the header.\n                    header_params = cls._split_header(auth_header)\n                    parameters.update(header_params)\n                except:\n                    raise Error('Unable to parse OAuth parameters from '\n                        'Authorization header.')\n \n        # GET or POST query string.\n        if query_string:\n            query_params = cls._split_url_string(query_string)\n            parameters.update(query_params)\n \n        # URL parameters.\n        param_str = urlparse.urlparse(http_url)[4] # query\n        url_params = cls._split_url_string(param_str)\n        parameters.update(url_params)\n \n        if parameters:\n            return cls(http_method, http_url, parameters)\n \n        return None\n \n    @classmethod\n    def from_consumer_and_token(cls, consumer, token=None,\n            http_method=HTTP_METHOD, http_url=None, parameters=None,\n            body='', is_form_encoded=False):\n        if not parameters:\n            parameters = {}\n \n        defaults = {\n            'oauth_consumer_key': consumer.key,\n            'oauth_timestamp': cls.make_timestamp(),\n            'oauth_nonce': cls.make_nonce(),\n            'oauth_version': cls.version,\n        }\n \n        defaults.update(parameters)\n        parameters = defaults\n \n        if token:\n            parameters['oauth_token'] = token.key\n            if token.verifier:\n                parameters['oauth_verifier'] = token.verifier\n \n        return Request(http_method, http_url, parameters, body=body, \n                       is_form_encoded=is_form_encoded)\n \n    @classmethod\n    def from_token_and_callback(cls, token, callback=None, \n        http_method=HTTP_METHOD, http_url=None, parameters=None):\n\n        if not parameters:\n            parameters = {}\n \n        parameters['oauth_token'] = token.key\n \n        if callback:\n            parameters['oauth_callback'] = callback\n \n        return cls(http_method, http_url, parameters)\n \n    @staticmethod\n    def _split_header(header):\n        \"\"\"Turn Authorization: header into parameters.\"\"\"\n        params = {}\n        parts = header.split(',')\n        for param in parts:\n            # Ignore realm parameter.\n            if param.find('realm') > -1:\n                continue\n            # Remove whitespace.\n            param = param.strip()\n            # Split key-value.\n            param_parts = param.split('=', 1)\n            # Remove quotes and unescape the value.\n            params[param_parts[0]] = urllib.unquote(param_parts[1].strip('\\\"'))\n        return params\n \n    @staticmethod\n    def _split_url_string(param_str):\n        \"\"\"Turn URL string into parameters.\"\"\"\n        parameters = parse_qs(param_str.encode('utf-8'), keep_blank_values=True)\n        for k, v in parameters.iteritems():\n            parameters[k] = urllib.unquote(v[0])\n        return parameters\n\n\nclass Client(httplib2.Http):\n    \"\"\"OAuthClient is a worker to attempt to execute a request.\"\"\"\n\n    def __init__(self, consumer, token=None, cache=None, timeout=None,\n        proxy_info=None):\n\n        if consumer is not None and not isinstance(consumer, Consumer):\n            raise ValueError(\"Invalid consumer.\")\n\n        if token is not None and not isinstance(token, Token):\n            raise ValueError(\"Invalid token.\")\n\n        self.consumer = consumer\n        self.token = token\n        self.method = SignatureMethod_HMAC_SHA1()\n\n        httplib2.Http.__init__(self, cache=cache, timeout=timeout, proxy_info=proxy_info)\n\n    def set_signature_method(self, method):\n        if not isinstance(method, SignatureMethod):\n            raise ValueError(\"Invalid signature method.\")\n\n        self.method = method\n\n    def request(self, uri, method=\"GET\", body='', headers=None, \n        redirections=httplib2.DEFAULT_MAX_REDIRECTS, connection_type=None):\n        DEFAULT_POST_CONTENT_TYPE = 'application/x-www-form-urlencoded'\n\n        if not isinstance(headers, dict):\n            headers = {}\n\n        if method == \"POST\":\n            headers['Content-Type'] = headers.get('Content-Type', \n                DEFAULT_POST_CONTENT_TYPE)\n\n        is_form_encoded = \\\n            headers.get('Content-Type') == 'application/x-www-form-urlencoded'\n\n        if is_form_encoded and body:\n            parameters = parse_qs(body)\n        else:\n            parameters = None\n\n        req = Request.from_consumer_and_token(self.consumer, \n            token=self.token, http_method=method, http_url=uri, \n            parameters=parameters, body=body, is_form_encoded=is_form_encoded)\n\n        req.sign_request(self.method, self.consumer, self.token)\n\n        schema, rest = urllib.splittype(uri)\n        if rest.startswith('//'):\n            hierpart = '//'\n        else:\n            hierpart = ''\n        host, rest = urllib.splithost(rest)\n\n        realm = schema + ':' + hierpart + host\n\n        if is_form_encoded:\n            body = req.to_postdata()\n        elif method == \"GET\":\n            uri = req.to_url()\n        else:\n            headers.update(req.to_header(realm=realm))\n\n        return httplib2.Http.request(self, uri, method=method, body=body,\n            headers=headers, redirections=redirections,\n            connection_type=connection_type)\n\n\nclass Server(object):\n    \"\"\"A skeletal implementation of a service provider, providing protected\n    resources to requests from authorized consumers.\n \n    This class implements the logic to check requests for authorization. You\n    can use it with your web server or web framework to protect certain\n    resources with OAuth.\n    \"\"\"\n\n    timestamp_threshold = 300 # In seconds, five minutes.\n    version = OAUTH_VERSION\n    signature_methods = None\n\n    def __init__(self, signature_methods=None):\n        self.signature_methods = signature_methods or {}\n\n    def add_signature_method(self, signature_method):\n        self.signature_methods[signature_method.name] = signature_method\n        return self.signature_methods\n\n    def verify_request(self, request, consumer, token):\n        \"\"\"Verifies an api call and checks all the parameters.\"\"\"\n\n        self._check_version(request)\n        self._check_signature(request, consumer, token)\n        parameters = request.get_nonoauth_parameters()\n        return parameters\n\n    def build_authenticate_header(self, realm=''):\n        \"\"\"Optional support for the authenticate header.\"\"\"\n        return {'WWW-Authenticate': 'OAuth realm=\"%s\"' % realm}\n\n    def _check_version(self, request):\n        \"\"\"Verify the correct version of the request for this server.\"\"\"\n        version = self._get_version(request)\n        if version and version != self.version:\n            raise Error('OAuth version %s not supported.' % str(version))\n\n    def _get_version(self, request):\n        \"\"\"Return the version of the request for this server.\"\"\"\n        try:\n            version = request.get_parameter('oauth_version')\n        except:\n            version = OAUTH_VERSION\n\n        return version\n\n    def _get_signature_method(self, request):\n        \"\"\"Figure out the signature with some defaults.\"\"\"\n        try:\n            signature_method = request.get_parameter('oauth_signature_method')\n        except:\n            signature_method = SIGNATURE_METHOD\n\n        try:\n            # Get the signature method object.\n            signature_method = self.signature_methods[signature_method]\n        except:\n            signature_method_names = ', '.join(self.signature_methods.keys())\n            raise Error('Signature method %s not supported try one of the following: %s' % (signature_method, signature_method_names))\n\n        return signature_method\n\n    def _get_verifier(self, request):\n        return request.get_parameter('oauth_verifier')\n\n    def _check_signature(self, request, consumer, token):\n        timestamp, nonce = request._get_timestamp_nonce()\n        self._check_timestamp(timestamp)\n        signature_method = self._get_signature_method(request)\n\n        try:\n            signature = request.get_parameter('oauth_signature')\n        except:\n            raise MissingSignature('Missing oauth_signature.')\n\n        # Validate the signature.\n        valid = signature_method.check(request, consumer, token, signature)\n\n        if not valid:\n            key, base = signature_method.signing_base(request, consumer, token)\n\n            raise Error('Invalid signature. Expected signature base ' \n                'string: %s' % base)\n\n    def _check_timestamp(self, timestamp):\n        \"\"\"Verify that timestamp is recentish.\"\"\"\n        timestamp = int(timestamp)\n        now = int(time.time())\n        lapsed = now - timestamp\n        if lapsed > self.timestamp_threshold:\n            raise Error('Expired timestamp: given %d and now %s has a '\n                'greater difference than threshold %d' % (timestamp, now, \n                    self.timestamp_threshold))\n\n\nclass SignatureMethod(object):\n    \"\"\"A way of signing requests.\n \n    The OAuth protocol lets consumers and service providers pick a way to sign\n    requests. This interface shows the methods expected by the other `oauth`\n    modules for signing requests. Subclass it and implement its methods to\n    provide a new way to sign requests.\n    \"\"\"\n\n    def signing_base(self, request, consumer, token):\n        \"\"\"Calculates the string that needs to be signed.\n\n        This method returns a 2-tuple containing the starting key for the\n        signing and the message to be signed. The latter may be used in error\n        messages to help clients debug their software.\n\n        \"\"\"\n        raise NotImplementedError\n\n    def sign(self, request, consumer, token):\n        \"\"\"Returns the signature for the given request, based on the consumer\n        and token also provided.\n\n        You should use your implementation of `signing_base()` to build the\n        message to sign. Otherwise it may be less useful for debugging.\n\n        \"\"\"\n        raise NotImplementedError\n\n    def check(self, request, consumer, token, signature):\n        \"\"\"Returns whether the given signature is the correct signature for\n        the given consumer and token signing the given request.\"\"\"\n        built = self.sign(request, consumer, token)\n        return built == signature\n\n\nclass SignatureMethod_HMAC_SHA1(SignatureMethod):\n    name = 'HMAC-SHA1'\n\n    def signing_base(self, request, consumer, token):\n        if not hasattr(request, 'normalized_url') or request.normalized_url is None:\n            raise ValueError(\"Base URL for request is not set.\")\n\n        sig = (\n            escape(request.method),\n            escape(request.normalized_url),\n            escape(request.get_normalized_parameters()),\n        )\n\n        key = '%s&' % escape(consumer.secret)\n        if token:\n            key += escape(token.secret)\n        raw = '&'.join(sig)\n        return key, raw\n\n    def sign(self, request, consumer, token):\n        \"\"\"Builds the base signature string.\"\"\"\n        key, raw = self.signing_base(request, consumer, token)\n\n        hashed = hmac.new(key, raw, sha)\n\n        # Calculate the digest base 64.\n        return binascii.b2a_base64(hashed.digest())[:-1]\n\n\nclass SignatureMethod_PLAINTEXT(SignatureMethod):\n\n    name = 'PLAINTEXT'\n\n    def signing_base(self, request, consumer, token):\n        \"\"\"Concatenates the consumer key and secret with the token's\n        secret.\"\"\"\n        sig = '%s&' % escape(consumer.secret)\n        if token:\n            sig = sig + escape(token.secret)\n        return sig, sig\n\n    def sign(self, request, consumer, token):\n        key, raw = self.signing_base(request, consumer, token)\n        return raw\n"
  },
  {
    "path": "lib/oauth2/_version.py",
    "content": "# This is the version of this source code.\n\nmanual_verstr = \"1.5\"\n\n\n\nauto_build_num = \"211\"\n\n\n\nverstr = manual_verstr + \".\" + auto_build_num\ntry:\n    from pyutil.version_class import Version as pyutil_Version\n    __version__ = pyutil_Version(verstr)\nexcept (ImportError, ValueError):\n    # Maybe there is no pyutil installed.\n    from distutils.version import LooseVersion as distutils_Version\n    __version__ = distutils_Version(verstr)\n"
  },
  {
    "path": "lib/oauth2/clients/__init__.py",
    "content": ""
  },
  {
    "path": "lib/oauth2/clients/imap.py",
    "content": "\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\"\"\"\n\nimport oauth2\nimport imaplib\n\n\nclass IMAP4_SSL(imaplib.IMAP4_SSL):\n    \"\"\"IMAP wrapper for imaplib.IMAP4_SSL that implements XOAUTH.\"\"\"\n\n    def authenticate(self, url, consumer, token):\n        if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n            raise ValueError(\"Invalid consumer.\")\n\n        if token is not None and not isinstance(token, oauth2.Token):\n            raise ValueError(\"Invalid token.\")\n\n        imaplib.IMAP4_SSL.authenticate(self, 'XOAUTH',\n            lambda x: oauth2.build_xoauth_string(url, consumer, token))\n"
  },
  {
    "path": "lib/oauth2/clients/smtp.py",
    "content": "\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\"\"\"\n\nimport oauth2\nimport smtplib\nimport base64\n\n\nclass SMTP(smtplib.SMTP):\n    \"\"\"SMTP wrapper for smtplib.SMTP that implements XOAUTH.\"\"\"\n\n    def authenticate(self, url, consumer, token):\n        if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n            raise ValueError(\"Invalid consumer.\")\n\n        if token is not None and not isinstance(token, oauth2.Token):\n            raise ValueError(\"Invalid token.\")\n\n        self.docmd('AUTH', 'XOAUTH %s' % \\\n            base64.b64encode(oauth2.build_xoauth_string(url, consumer, token)))\n"
  },
  {
    "path": "lib/thrift/TSCons.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\nfrom os import path\nfrom SCons.Builder import Builder\n\ndef scons_env(env, add=''):\n  opath = path.dirname(path.abspath('$TARGET'))\n  lstr = 'thrift --gen cpp -o ' + opath + ' ' + add + ' $SOURCE'\n  cppbuild = Builder(action = lstr)\n  env.Append(BUILDERS = {'ThriftCpp' : cppbuild})\n\ndef gen_cpp(env, dir, file):\n  scons_env(env)\n  suffixes = ['_types.h', '_types.cpp']\n  targets = map(lambda s: 'gen-cpp/' + file + s, suffixes)\n  return env.ThriftCpp(targets, dir+file+'.thrift')\n"
  },
  {
    "path": "lib/thrift/TSerialization.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\nfrom protocol import TBinaryProtocol\nfrom transport import TTransport\n\ndef serialize(thrift_object, protocol_factory = TBinaryProtocol.TBinaryProtocolFactory()):\n    transport = TTransport.TMemoryBuffer()\n    protocol = protocol_factory.getProtocol(transport)\n    thrift_object.write(protocol)\n    return transport.getvalue()\n\ndef deserialize(base, buf, protocol_factory = TBinaryProtocol.TBinaryProtocolFactory()):\n    transport = TTransport.TMemoryBuffer(buf)\n    protocol = protocol_factory.getProtocol(transport)\n    base.read(protocol)\n    return base\n\n"
  },
  {
    "path": "lib/thrift/Thrift.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\nimport sys\n\nclass TType:\n  STOP   = 0\n  VOID   = 1\n  BOOL   = 2\n  BYTE   = 3\n  I08    = 3\n  DOUBLE = 4\n  I16    = 6\n  I32    = 8\n  I64    = 10\n  STRING = 11\n  UTF7   = 11\n  STRUCT = 12\n  MAP    = 13\n  SET    = 14\n  LIST   = 15\n  UTF8   = 16\n  UTF16  = 17\n\n  _VALUES_TO_NAMES = ( 'STOP',\n                      'VOID',\n                      'BOOL',\n                      'BYTE',\n                      'DOUBLE',\n                      None,\n                      'I16',\n                      None,\n                      'I32',\n                      None,\n                       'I64',\n                       'STRING',\n                       'STRUCT',\n                       'MAP',\n                       'SET',\n                       'LIST',\n                       'UTF8',\n                       'UTF16' )\n\nclass TMessageType:\n  CALL  = 1\n  REPLY = 2\n  EXCEPTION = 3\n  ONEWAY = 4\n\nclass TProcessor:\n\n  \"\"\"Base class for procsessor, which works on two streams.\"\"\"\n\n  def process(iprot, oprot):\n    pass\n\nclass TException(Exception):\n\n  \"\"\"Base class for all thrift exceptions.\"\"\"\n\n  # BaseException.message is deprecated in Python v[2.6,3.0)\n  if (2,6,0) <= sys.version_info < (3,0):\n    def _get_message(self):\n\t    return self._message\n    def _set_message(self, message):\n\t    self._message = message\n    message = property(_get_message, _set_message)\n\n  def __init__(self, message=None):\n    Exception.__init__(self, message)\n    self.message = message\n\nclass TApplicationException(TException):\n\n  \"\"\"Application level thrift exceptions.\"\"\"\n\n  UNKNOWN = 0\n  UNKNOWN_METHOD = 1\n  INVALID_MESSAGE_TYPE = 2\n  WRONG_METHOD_NAME = 3\n  BAD_SEQUENCE_ID = 4\n  MISSING_RESULT = 5\n  INTERNAL_ERROR = 6\n  PROTOCOL_ERROR = 7\n\n  def __init__(self, type=UNKNOWN, message=None):\n    TException.__init__(self, message)\n    self.type = type\n\n  def __str__(self):\n    if self.message:\n      return self.message\n    elif self.type == self.UNKNOWN_METHOD:\n      return 'Unknown method'\n    elif self.type == self.INVALID_MESSAGE_TYPE:\n      return 'Invalid message type'\n    elif self.type == self.WRONG_METHOD_NAME:\n      return 'Wrong method name'\n    elif self.type == self.BAD_SEQUENCE_ID:\n      return 'Bad sequence ID'\n    elif self.type == self.MISSING_RESULT:\n      return 'Missing result'\n    else:\n      return 'Default (unknown) TApplicationException'\n\n  def read(self, iprot):\n    iprot.readStructBegin()\n    while True:\n      (fname, ftype, fid) = iprot.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      if fid == 1:\n        if ftype == TType.STRING:\n          self.message = iprot.readString();\n        else:\n          iprot.skip(ftype)\n      elif fid == 2:\n        if ftype == TType.I32:\n          self.type = iprot.readI32();\n        else:\n          iprot.skip(ftype)\n      else:\n        iprot.skip(ftype)\n      iprot.readFieldEnd()\n    iprot.readStructEnd()\n\n  def write(self, oprot):\n    oprot.writeStructBegin('TApplicationException')\n    if self.message != None:\n      oprot.writeFieldBegin('message', TType.STRING, 1)\n      oprot.writeString(self.message)\n      oprot.writeFieldEnd()\n    if self.type != None:\n      oprot.writeFieldBegin('type', TType.I32, 2)\n      oprot.writeI32(self.type)\n      oprot.writeFieldEnd()\n    oprot.writeFieldStop()\n    oprot.writeStructEnd()\n"
  },
  {
    "path": "lib/thrift/__init__.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\n__all__ = ['Thrift', 'TSCons']\n"
  },
  {
    "path": "lib/thrift/protocol/TBase.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\nfrom thrift.Thrift import *\nfrom thrift.protocol import TBinaryProtocol\nfrom thrift.transport import TTransport\n\ntry:\n  from thrift.protocol import fastbinary\nexcept:\n  fastbinary = None\n\nclass TBase(object):\n  __slots__ = []\n\n  def __repr__(self):\n    L = ['%s=%r' % (key, getattr(self, key))\n              for key in self.__slots__ ]\n    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n  def __eq__(self, other):\n    if not isinstance(other, self.__class__):\n      return False\n    for attr in self.__slots__:\n      my_val = getattr(self, attr)\n      other_val = getattr(other, attr)\n      if my_val != other_val:\n        return False\n    return True\n    \n  def __ne__(self, other):\n    return not (self == other)\n  \n  def read(self, iprot):\n    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n      return\n    iprot.readStruct(self, self.thrift_spec)\n\n  def write(self, oprot):\n    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n      return\n    oprot.writeStruct(self, self.thrift_spec)\n\nclass TExceptionBase(Exception):\n  # old style class so python2.4 can raise exceptions derived from this\n  #  This can't inherit from TBase because of that limitation.\n  __slots__ = []\n  \n  __repr__ = TBase.__repr__.im_func\n  __eq__ = TBase.__eq__.im_func\n  __ne__ = TBase.__ne__.im_func\n  read = TBase.read.im_func\n  write = TBase.write.im_func\n  \n"
  },
  {
    "path": "lib/thrift/protocol/TBinaryProtocol.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\nfrom TProtocol import *\nfrom struct import pack, unpack\n\nclass TBinaryProtocol(TProtocolBase):\n\n  \"\"\"Binary implementation of the Thrift protocol driver.\"\"\"\n\n  # NastyHaxx. Python 2.4+ on 32-bit machines forces hex constants to be\n  # positive, converting this into a long. If we hardcode the int value\n  # instead it'll stay in 32 bit-land.\n\n  # VERSION_MASK = 0xffff0000\n  VERSION_MASK = -65536\n\n  # VERSION_1 = 0x80010000\n  VERSION_1 = -2147418112\n\n  TYPE_MASK = 0x000000ff\n\n  def __init__(self, trans, strictRead=False, strictWrite=True):\n    TProtocolBase.__init__(self, trans)\n    self.strictRead = strictRead\n    self.strictWrite = strictWrite\n\n  def writeMessageBegin(self, name, type, seqid):\n    if self.strictWrite:\n      self.writeI32(TBinaryProtocol.VERSION_1 | type)\n      self.writeString(name)\n      self.writeI32(seqid)\n    else:\n      self.writeString(name)\n      self.writeByte(type)\n      self.writeI32(seqid)\n\n  def writeMessageEnd(self):\n    pass\n\n  def writeStructBegin(self, name):\n    pass\n\n  def writeStructEnd(self):\n    pass\n\n  def writeFieldBegin(self, name, type, id):\n    self.writeByte(type)\n    self.writeI16(id)\n\n  def writeFieldEnd(self):\n    pass\n\n  def writeFieldStop(self):\n    self.writeByte(TType.STOP);\n\n  def writeMapBegin(self, ktype, vtype, size):\n    self.writeByte(ktype)\n    self.writeByte(vtype)\n    self.writeI32(size)\n\n  def writeMapEnd(self):\n    pass\n\n  def writeListBegin(self, etype, size):\n    self.writeByte(etype)\n    self.writeI32(size)\n\n  def writeListEnd(self):\n    pass\n\n  def writeSetBegin(self, etype, size):\n    self.writeByte(etype)\n    self.writeI32(size)\n\n  def writeSetEnd(self):\n    pass\n\n  def writeBool(self, bool):\n    if bool:\n      self.writeByte(1)\n    else:\n      self.writeByte(0)\n\n  def writeByte(self, byte):\n    buff = pack(\"!b\", byte)\n    self.trans.write(buff)\n\n  def writeI16(self, i16):\n    buff = pack(\"!h\", i16)\n    self.trans.write(buff)\n\n  def writeI32(self, i32):\n    buff = pack(\"!i\", i32)\n    self.trans.write(buff)\n\n  def writeI64(self, i64):\n    buff = pack(\"!q\", i64)\n    self.trans.write(buff)\n\n  def writeDouble(self, dub):\n    buff = pack(\"!d\", dub)\n    self.trans.write(buff)\n\n  def writeString(self, str):\n    self.writeI32(len(str))\n    self.trans.write(str)\n\n  def readMessageBegin(self):\n    sz = self.readI32()\n    if sz < 0:\n      version = sz & TBinaryProtocol.VERSION_MASK\n      if version != TBinaryProtocol.VERSION_1:\n        raise TProtocolException(type=TProtocolException.BAD_VERSION, message='Bad version in readMessageBegin: %d' % (sz))\n      type = sz & TBinaryProtocol.TYPE_MASK\n      name = self.readString()\n      seqid = self.readI32()\n    else:\n      if self.strictRead:\n        raise TProtocolException(type=TProtocolException.BAD_VERSION, message='No protocol version header')\n      name = self.trans.readAll(sz)\n      type = self.readByte()\n      seqid = self.readI32()\n    return (name, type, seqid)\n\n  def readMessageEnd(self):\n    pass\n\n  def readStructBegin(self):\n    pass\n\n  def readStructEnd(self):\n    pass\n\n  def readFieldBegin(self):\n    type = self.readByte()\n    if type == TType.STOP:\n      return (None, type, 0)\n    id = self.readI16()\n    return (None, type, id)\n\n  def readFieldEnd(self):\n    pass\n\n  def readMapBegin(self):\n    ktype = self.readByte()\n    vtype = self.readByte()\n    size = self.readI32()\n    return (ktype, vtype, size)\n\n  def readMapEnd(self):\n    pass\n\n  def readListBegin(self):\n    etype = self.readByte()\n    size = self.readI32()\n    return (etype, size)\n\n  def readListEnd(self):\n    pass\n\n  def readSetBegin(self):\n    etype = self.readByte()\n    size = self.readI32()\n    return (etype, size)\n\n  def readSetEnd(self):\n    pass\n\n  def readBool(self):\n    byte = self.readByte()\n    if byte == 0:\n      return False\n    return True\n\n  def readByte(self):\n    buff = self.trans.readAll(1)\n    val, = unpack('!b', buff)\n    return val\n\n  def readI16(self):\n    buff = self.trans.readAll(2)\n    val, = unpack('!h', buff)\n    return val\n\n  def readI32(self):\n    buff = self.trans.readAll(4)\n    val, = unpack('!i', buff)\n    return val\n\n  def readI64(self):\n    buff = self.trans.readAll(8)\n    val, = unpack('!q', buff)\n    return val\n\n  def readDouble(self):\n    buff = self.trans.readAll(8)\n    val, = unpack('!d', buff)\n    return val\n\n  def readString(self):\n    len = self.readI32()\n    str = self.trans.readAll(len)\n    return str\n\n\nclass TBinaryProtocolFactory:\n  def __init__(self, strictRead=False, strictWrite=True):\n    self.strictRead = strictRead\n    self.strictWrite = strictWrite\n\n  def getProtocol(self, trans):\n    prot = TBinaryProtocol(trans, self.strictRead, self.strictWrite)\n    return prot\n\n\nclass TBinaryProtocolAccelerated(TBinaryProtocol):\n\n  \"\"\"C-Accelerated version of TBinaryProtocol.\n\n  This class does not override any of TBinaryProtocol's methods,\n  but the generated code recognizes it directly and will call into\n  our C module to do the encoding, bypassing this object entirely.\n  We inherit from TBinaryProtocol so that the normal TBinaryProtocol\n  encoding can happen if the fastbinary module doesn't work for some\n  reason.  (TODO(dreiss): Make this happen sanely in more cases.)\n\n  In order to take advantage of the C module, just use\n  TBinaryProtocolAccelerated instead of TBinaryProtocol.\n\n  NOTE:  This code was contributed by an external developer.\n         The internal Thrift team has reviewed and tested it,\n         but we cannot guarantee that it is production-ready.\n         Please feel free to report bugs and/or success stories\n         to the public mailing list.\n  \"\"\"\n\n  pass\n\n\nclass TBinaryProtocolAcceleratedFactory:\n  def getProtocol(self, trans):\n    return TBinaryProtocolAccelerated(trans)\n"
  },
  {
    "path": "lib/thrift/protocol/TCompactProtocol.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\nfrom TProtocol import *\nfrom struct import pack, unpack\n\n__all__ = ['TCompactProtocol', 'TCompactProtocolFactory']\n\nCLEAR = 0\nFIELD_WRITE = 1\nVALUE_WRITE = 2\nCONTAINER_WRITE = 3\nBOOL_WRITE = 4\nFIELD_READ = 5\nCONTAINER_READ = 6\nVALUE_READ = 7\nBOOL_READ = 8\n\ndef make_helper(v_from, container):\n  def helper(func):\n    def nested(self, *args, **kwargs):\n      assert self.state in (v_from, container), (self.state, v_from, container)\n      return func(self, *args, **kwargs)\n    return nested\n  return helper\nwriter = make_helper(VALUE_WRITE, CONTAINER_WRITE)\nreader = make_helper(VALUE_READ, CONTAINER_READ)\n\ndef makeZigZag(n, bits):\n  return (n << 1) ^ (n >> (bits - 1))\n\ndef fromZigZag(n):\n  return (n >> 1) ^ -(n & 1)\n\ndef writeVarint(trans, n):\n  out = []\n  while True:\n    if n & ~0x7f == 0:\n      out.append(n)\n      break\n    else:\n      out.append((n & 0xff) | 0x80)\n      n = n >> 7\n  trans.write(''.join(map(chr, out)))\n\ndef readVarint(trans):\n  result = 0\n  shift = 0\n  while True:\n    x = trans.readAll(1)\n    byte = ord(x)\n    result |= (byte & 0x7f) << shift\n    if byte >> 7 == 0:\n      return result\n    shift += 7\n\nclass CompactType:\n  STOP = 0x00\n  TRUE = 0x01\n  FALSE = 0x02\n  BYTE = 0x03\n  I16 = 0x04\n  I32 = 0x05\n  I64 = 0x06\n  DOUBLE = 0x07\n  BINARY = 0x08\n  LIST = 0x09\n  SET = 0x0A\n  MAP = 0x0B\n  STRUCT = 0x0C\n\nCTYPES = {TType.STOP: CompactType.STOP,\n          TType.BOOL: CompactType.TRUE, # used for collection\n          TType.BYTE: CompactType.BYTE,\n          TType.I16: CompactType.I16,\n          TType.I32: CompactType.I32,\n          TType.I64: CompactType.I64,\n          TType.DOUBLE: CompactType.DOUBLE,\n          TType.STRING: CompactType.BINARY,\n          TType.STRUCT: CompactType.STRUCT,\n          TType.LIST: CompactType.LIST,\n          TType.SET: CompactType.SET,\n          TType.MAP: CompactType.MAP\n          }\n\nTTYPES = {}\nfor k, v in CTYPES.items():\n  TTYPES[v] = k\nTTYPES[CompactType.FALSE] = TType.BOOL\ndel k\ndel v\n\nclass TCompactProtocol(TProtocolBase):\n  \"Compact implementation of the Thrift protocol driver.\"\n\n  PROTOCOL_ID = 0x82\n  VERSION = 1\n  VERSION_MASK = 0x1f\n  TYPE_MASK = 0xe0\n  TYPE_SHIFT_AMOUNT = 5\n\n  def __init__(self, trans):\n    TProtocolBase.__init__(self, trans)\n    self.state = CLEAR\n    self.__last_fid = 0\n    self.__bool_fid = None\n    self.__bool_value = None\n    self.__structs = []\n    self.__containers = []\n\n  def __writeVarint(self, n):\n    writeVarint(self.trans, n)\n\n  def writeMessageBegin(self, name, type, seqid):\n    assert self.state == CLEAR\n    self.__writeUByte(self.PROTOCOL_ID)\n    self.__writeUByte(self.VERSION | (type << self.TYPE_SHIFT_AMOUNT))\n    self.__writeVarint(seqid)\n    self.__writeString(name)\n    self.state = VALUE_WRITE\n\n  def writeMessageEnd(self):\n    assert self.state == VALUE_WRITE\n    self.state = CLEAR\n\n  def writeStructBegin(self, name):\n    assert self.state in (CLEAR, CONTAINER_WRITE, VALUE_WRITE), self.state\n    self.__structs.append((self.state, self.__last_fid))\n    self.state = FIELD_WRITE\n    self.__last_fid = 0\n\n  def writeStructEnd(self):\n    assert self.state == FIELD_WRITE\n    self.state, self.__last_fid = self.__structs.pop()\n\n  def writeFieldStop(self):\n    self.__writeByte(0)\n\n  def __writeFieldHeader(self, type, fid):\n    delta = fid - self.__last_fid\n    if 0 < delta <= 15:\n      self.__writeUByte(delta << 4 | type)\n    else:\n      self.__writeByte(type)\n      self.__writeI16(fid)\n    self.__last_fid = fid\n\n  def writeFieldBegin(self, name, type, fid):\n    assert self.state == FIELD_WRITE, self.state\n    if type == TType.BOOL:\n      self.state = BOOL_WRITE\n      self.__bool_fid = fid\n    else:\n      self.state = VALUE_WRITE\n      self.__writeFieldHeader(CTYPES[type], fid)\n\n  def writeFieldEnd(self):\n    assert self.state in (VALUE_WRITE, BOOL_WRITE), self.state\n    self.state = FIELD_WRITE\n\n  def __writeUByte(self, byte):\n    self.trans.write(pack('!B', byte))\n\n  def __writeByte(self, byte):\n    self.trans.write(pack('!b', byte))\n\n  def __writeI16(self, i16):\n    self.__writeVarint(makeZigZag(i16, 16))\n\n  def __writeSize(self, i32):\n    self.__writeVarint(i32)\n\n  def writeCollectionBegin(self, etype, size):\n    assert self.state in (VALUE_WRITE, CONTAINER_WRITE), self.state\n    if size <= 14:\n      self.__writeUByte(size << 4 | CTYPES[etype])\n    else:\n      self.__writeUByte(0xf0 | CTYPES[etype])\n      self.__writeSize(size)\n    self.__containers.append(self.state)\n    self.state = CONTAINER_WRITE\n  writeSetBegin = writeCollectionBegin\n  writeListBegin = writeCollectionBegin\n\n  def writeMapBegin(self, ktype, vtype, size):\n    assert self.state in (VALUE_WRITE, CONTAINER_WRITE), self.state\n    if size == 0:\n      self.__writeByte(0)\n    else:\n      self.__writeSize(size)\n      self.__writeUByte(CTYPES[ktype] << 4 | CTYPES[vtype])\n    self.__containers.append(self.state)\n    self.state = CONTAINER_WRITE\n\n  def writeCollectionEnd(self):\n    assert self.state == CONTAINER_WRITE, self.state\n    self.state = self.__containers.pop()\n  writeMapEnd = writeCollectionEnd\n  writeSetEnd = writeCollectionEnd\n  writeListEnd = writeCollectionEnd\n\n  def writeBool(self, bool):\n    if self.state == BOOL_WRITE:\n        if bool:\n            ctype = CompactType.TRUE\n        else:\n            ctype = CompactType.FALSE\n        self.__writeFieldHeader(ctype, self.__bool_fid)\n    elif self.state == CONTAINER_WRITE:\n       if bool:\n           self.__writeByte(CompactType.TRUE)\n       else:\n           self.__writeByte(CompactType.FALSE)\n    else:\n      raise AssertionError, \"Invalid state in compact protocol\"\n\n  writeByte = writer(__writeByte)\n  writeI16 = writer(__writeI16)\n\n  @writer\n  def writeI32(self, i32):\n    self.__writeVarint(makeZigZag(i32, 32))\n\n  @writer\n  def writeI64(self, i64):\n    self.__writeVarint(makeZigZag(i64, 64))\n\n  @writer\n  def writeDouble(self, dub):\n    self.trans.write(pack('!d', dub))\n\n  def __writeString(self, s):\n    self.__writeSize(len(s))\n    self.trans.write(s)\n  writeString = writer(__writeString)\n\n  def readFieldBegin(self):\n    assert self.state == FIELD_READ, self.state\n    type = self.__readUByte()\n    if type & 0x0f == TType.STOP:\n      return (None, 0, 0)\n    delta = type >> 4\n    if delta == 0:\n      fid = self.__readI16()\n    else:\n      fid = self.__last_fid + delta\n    self.__last_fid = fid\n    type = type & 0x0f\n    if type == CompactType.TRUE:\n      self.state = BOOL_READ\n      self.__bool_value = True\n    elif type == CompactType.FALSE:\n      self.state = BOOL_READ\n      self.__bool_value = False\n    else:\n      self.state = VALUE_READ\n    return (None, self.__getTType(type), fid)\n\n  def readFieldEnd(self):\n    assert self.state in (VALUE_READ, BOOL_READ), self.state\n    self.state = FIELD_READ\n\n  def __readUByte(self):\n    result, = unpack('!B', self.trans.readAll(1))\n    return result\n\n  def __readByte(self):\n    result, = unpack('!b', self.trans.readAll(1))\n    return result\n\n  def __readVarint(self):\n    return readVarint(self.trans)\n\n  def __readZigZag(self):\n    return fromZigZag(self.__readVarint())\n\n  def __readSize(self):\n    result = self.__readVarint()\n    if result < 0:\n      raise TException(\"Length < 0\")\n    return result\n\n  def readMessageBegin(self):\n    assert self.state == CLEAR\n    proto_id = self.__readUByte()\n    if proto_id != self.PROTOCOL_ID:\n      raise TProtocolException(TProtocolException.BAD_VERSION,\n          'Bad protocol id in the message: %d' % proto_id)\n    ver_type = self.__readUByte()\n    type = (ver_type & self.TYPE_MASK) >> self.TYPE_SHIFT_AMOUNT\n    version = ver_type & self.VERSION_MASK\n    if version != self.VERSION:\n      raise TProtocolException(TProtocolException.BAD_VERSION,\n          'Bad version: %d (expect %d)' % (version, self.VERSION))\n    seqid = self.__readVarint()\n    name = self.__readString()\n    return (name, type, seqid)\n\n  def readMessageEnd(self):\n    assert self.state == CLEAR\n    assert len(self.__structs) == 0\n\n  def readStructBegin(self):\n    assert self.state in (CLEAR, CONTAINER_READ, VALUE_READ), self.state\n    self.__structs.append((self.state, self.__last_fid))\n    self.state = FIELD_READ\n    self.__last_fid = 0\n\n  def readStructEnd(self):\n    assert self.state == FIELD_READ\n    self.state, self.__last_fid = self.__structs.pop()\n\n  def readCollectionBegin(self):\n    assert self.state in (VALUE_READ, CONTAINER_READ), self.state\n    size_type = self.__readUByte()\n    size = size_type >> 4\n    type = self.__getTType(size_type)\n    if size == 15:\n      size = self.__readSize()\n    self.__containers.append(self.state)\n    self.state = CONTAINER_READ\n    return type, size\n  readSetBegin = readCollectionBegin\n  readListBegin = readCollectionBegin\n\n  def readMapBegin(self):\n    assert self.state in (VALUE_READ, CONTAINER_READ), self.state\n    size = self.__readSize()\n    types = 0\n    if size > 0:\n      types = self.__readUByte()\n    vtype = self.__getTType(types)\n    ktype = self.__getTType(types >> 4)\n    self.__containers.append(self.state)\n    self.state = CONTAINER_READ\n    return (ktype, vtype, size)\n\n  def readCollectionEnd(self):\n    assert self.state == CONTAINER_READ, self.state\n    self.state = self.__containers.pop()\n  readSetEnd = readCollectionEnd\n  readListEnd = readCollectionEnd\n  readMapEnd = readCollectionEnd\n\n  def readBool(self):\n    if self.state == BOOL_READ:\n      return self.__bool_value == CompactType.TRUE\n    elif self.state == CONTAINER_READ:\n      return self.__readByte() == CompactType.TRUE\n    else:\n      raise AssertionError, \"Invalid state in compact protocol: %d\" % self.state\n\n  readByte = reader(__readByte)\n  __readI16 = __readZigZag\n  readI16 = reader(__readZigZag)\n  readI32 = reader(__readZigZag)\n  readI64 = reader(__readZigZag)\n\n  @reader\n  def readDouble(self):\n    buff = self.trans.readAll(8)\n    val, = unpack('!d', buff)\n    return val\n\n  def __readString(self):\n    len = self.__readSize()\n    return self.trans.readAll(len)\n  readString = reader(__readString)\n\n  def __getTType(self, byte):\n    return TTYPES[byte & 0x0f]\n\n\nclass TCompactProtocolFactory:\n  def __init__(self):\n    pass\n\n  def getProtocol(self, trans):\n    return TCompactProtocol(trans)\n"
  },
  {
    "path": "lib/thrift/protocol/TProtocol.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\nfrom thrift.Thrift import *\n\nclass TProtocolException(TException):\n\n  \"\"\"Custom Protocol Exception class\"\"\"\n\n  UNKNOWN = 0\n  INVALID_DATA = 1\n  NEGATIVE_SIZE = 2\n  SIZE_LIMIT = 3\n  BAD_VERSION = 4\n\n  def __init__(self, type=UNKNOWN, message=None):\n    TException.__init__(self, message)\n    self.type = type\n\nclass TProtocolBase:\n\n  \"\"\"Base class for Thrift protocol driver.\"\"\"\n\n  def __init__(self, trans):\n    self.trans = trans\n\n  def writeMessageBegin(self, name, type, seqid):\n    pass\n\n  def writeMessageEnd(self):\n    pass\n\n  def writeStructBegin(self, name):\n    pass\n\n  def writeStructEnd(self):\n    pass\n\n  def writeFieldBegin(self, name, type, id):\n    pass\n\n  def writeFieldEnd(self):\n    pass\n\n  def writeFieldStop(self):\n    pass\n\n  def writeMapBegin(self, ktype, vtype, size):\n    pass\n\n  def writeMapEnd(self):\n    pass\n\n  def writeListBegin(self, etype, size):\n    pass\n\n  def writeListEnd(self):\n    pass\n\n  def writeSetBegin(self, etype, size):\n    pass\n\n  def writeSetEnd(self):\n    pass\n\n  def writeBool(self, bool):\n    pass\n\n  def writeByte(self, byte):\n    pass\n\n  def writeI16(self, i16):\n    pass\n\n  def writeI32(self, i32):\n    pass\n\n  def writeI64(self, i64):\n    pass\n\n  def writeDouble(self, dub):\n    pass\n\n  def writeString(self, str):\n    pass\n\n  def readMessageBegin(self):\n    pass\n\n  def readMessageEnd(self):\n    pass\n\n  def readStructBegin(self):\n    pass\n\n  def readStructEnd(self):\n    pass\n\n  def readFieldBegin(self):\n    pass\n\n  def readFieldEnd(self):\n    pass\n\n  def readMapBegin(self):\n    pass\n\n  def readMapEnd(self):\n    pass\n\n  def readListBegin(self):\n    pass\n\n  def readListEnd(self):\n    pass\n\n  def readSetBegin(self):\n    pass\n\n  def readSetEnd(self):\n    pass\n\n  def readBool(self):\n    pass\n\n  def readByte(self):\n    pass\n\n  def readI16(self):\n    pass\n\n  def readI32(self):\n    pass\n\n  def readI64(self):\n    pass\n\n  def readDouble(self):\n    pass\n\n  def readString(self):\n    pass\n\n  def skip(self, type):\n    if type == TType.STOP:\n      return\n    elif type == TType.BOOL:\n      self.readBool()\n    elif type == TType.BYTE:\n      self.readByte()\n    elif type == TType.I16:\n      self.readI16()\n    elif type == TType.I32:\n      self.readI32()\n    elif type == TType.I64:\n      self.readI64()\n    elif type == TType.DOUBLE:\n      self.readDouble()\n    elif type == TType.STRING:\n      self.readString()\n    elif type == TType.STRUCT:\n      name = self.readStructBegin()\n      while True:\n        (name, type, id) = self.readFieldBegin()\n        if type == TType.STOP:\n          break\n        self.skip(type)\n        self.readFieldEnd()\n      self.readStructEnd()\n    elif type == TType.MAP:\n      (ktype, vtype, size) = self.readMapBegin()\n      for i in range(size):\n        self.skip(ktype)\n        self.skip(vtype)\n      self.readMapEnd()\n    elif type == TType.SET:\n      (etype, size) = self.readSetBegin()\n      for i in range(size):\n        self.skip(etype)\n      self.readSetEnd()\n    elif type == TType.LIST:\n      (etype, size) = self.readListBegin()\n      for i in range(size):\n        self.skip(etype)\n      self.readListEnd()\n\n  # tuple of: ( 'reader method' name, is_container boolean, 'writer_method' name )\n  _TTYPE_HANDLERS = (\n       (None, None, False), # 0 == TType,STOP\n       (None, None, False), # 1 == TType.VOID # TODO: handle void?\n       ('readBool', 'writeBool', False), # 2 == TType.BOOL\n       ('readByte',  'writeByte', False), # 3 == TType.BYTE and I08\n       ('readDouble', 'writeDouble', False), # 4 == TType.DOUBLE\n       (None, None, False), # 5, undefined\n       ('readI16', 'writeI16', False), # 6 == TType.I16\n       (None, None, False), # 7, undefined\n       ('readI32', 'writeI32', False), # 8 == TType.I32\n       (None, None, False), # 9, undefined\n       ('readI64', 'writeI64', False), # 10 == TType.I64\n       ('readString', 'writeString', False), # 11 == TType.STRING and UTF7\n       ('readContainerStruct', 'writeContainerStruct', True), # 12 == TType.STRUCT\n       ('readContainerMap', 'writeContainerMap', True), # 13 == TType.MAP\n       ('readContainerSet', 'writeContainerSet', True), # 14 == TType.SET\n       ('readContainerList', 'writeContainerList', True), # 15 == TType.LIST\n       (None, None, False), # 16 == TType.UTF8 # TODO: handle utf8 types?\n       (None, None, False)# 17 == TType.UTF16 # TODO: handle utf16 types?\n      )\n\n  def readFieldByTType(self, ttype, spec):\n    try:\n      (r_handler, w_handler, is_container) = self._TTYPE_HANDLERS[ttype]\n    except IndexError:\n      raise TProtocolException(type=TProtocolException.INVALID_DATA,\n                               message='Invalid field type %d' % (ttype))\n    if r_handler is None:\n      raise TProtocolException(type=TProtocolException.INVALID_DATA,\n                               message='Invalid field type %d' % (ttype))\n    reader = getattr(self, r_handler)\n    if not is_container:\n      return reader()\n    return reader(spec)\n\n  def readContainerList(self, spec):\n    results = []\n    ttype, tspec = spec[0], spec[1]\n    r_handler = self._TTYPE_HANDLERS[ttype][0]\n    reader = getattr(self, r_handler)\n    (list_type, list_len) = self.readListBegin()\n    if tspec is None:\n      # list values are simple types\n      for idx in xrange(list_len):\n        results.append(reader())\n    else:\n      # this is like an inlined readFieldByTType\n      container_reader = self._TTYPE_HANDLERS[list_type][0]\n      val_reader = getattr(self, container_reader)\n      for idx in xrange(list_len):\n        val = val_reader(tspec)\n        results.append(val)\n    self.readListEnd()\n    return results\n\n  def readContainerSet(self, spec):\n    results = set()\n    ttype, tspec = spec[0], spec[1]\n    r_handler = self._TTYPE_HANDLERS[ttype][0]\n    reader = getattr(self, r_handler)\n    (set_type, set_len) = self.readSetBegin()\n    if tspec is None:\n      # set members are simple types\n      for idx in xrange(set_len):\n        results.add(reader())\n    else:\n      container_reader = self._TTYPE_HANDLERS[set_type][0]\n      val_reader = getattr(self, container_reader)\n      for idx in xrange(set_len):\n        results.add(val_reader(tspec)) \n    self.readSetEnd()\n    return results\n\n  def readContainerStruct(self, spec):\n    (obj_class, obj_spec) = spec\n    obj = obj_class()\n    obj.read(self)\n    return obj\n  \n  def readContainerMap(self, spec):\n    results = dict()\n    key_ttype, key_spec = spec[0], spec[1]\n    val_ttype, val_spec = spec[2], spec[3]\n    (map_ktype, map_vtype, map_len) = self.readMapBegin()\n    # TODO: compare types we just decoded with thrift_spec and abort/skip if types disagree\n    key_reader = getattr(self, self._TTYPE_HANDLERS[key_ttype][0])\n    val_reader = getattr(self, self._TTYPE_HANDLERS[val_ttype][0])\n    # list values are simple types\n    for idx in xrange(map_len):\n      if key_spec is None:\n        k_val = key_reader()\n      else:\n        k_val = self.readFieldByTType(key_ttype, key_spec)\n      if val_spec is None:\n        v_val = val_reader()\n      else:\n        v_val = self.readFieldByTType(val_ttype, val_spec)\n      # this raises a TypeError with unhashable keys types. i.e. d=dict(); d[[0,1]] = 2 fails\n      results[k_val] = v_val\n    self.readMapEnd()\n    return results\n\n  def readStruct(self, obj, thrift_spec):\n    self.readStructBegin()\n    while True:\n      (fname, ftype, fid) = self.readFieldBegin()\n      if ftype == TType.STOP:\n        break\n      try:\n        field = thrift_spec[fid]\n      except IndexError:\n        self.skip(ftype)\n      else:\n        if field is not None and ftype == field[1]:\n          fname = field[2]\n          fspec = field[3]\n          val = self.readFieldByTType(ftype, fspec)\n          setattr(obj, fname, val)\n        else:\n          self.skip(ftype)\n      self.readFieldEnd()\n    self.readStructEnd()\n\n  def writeContainerStruct(self, val, spec):\n    val.write(self)\n\n  def writeContainerList(self, val, spec):\n    self.writeListBegin(spec[0], len(val))\n    r_handler, w_handler, is_container  = self._TTYPE_HANDLERS[spec[0]]\n    e_writer = getattr(self, w_handler)\n    if not is_container:\n      for elem in val:\n        e_writer(elem)\n    else:\n      for elem in val:\n        e_writer(elem, spec[1])\n    self.writeListEnd()\n\n  def writeContainerSet(self, val, spec):\n    self.writeSetBegin(spec[0], len(val))\n    r_handler, w_handler, is_container = self._TTYPE_HANDLERS[spec[0]]\n    e_writer = getattr(self, w_handler)\n    if not is_container:\n      for elem in val:\n        e_writer(elem)\n    else:\n      for elem in val:\n        e_writer(elem, spec[1])\n    self.writeSetEnd()\n\n  def writeContainerMap(self, val, spec):\n    k_type = spec[0]\n    v_type = spec[2]\n    ignore, ktype_name, k_is_container = self._TTYPE_HANDLERS[k_type]\n    ignore, vtype_name, v_is_container = self._TTYPE_HANDLERS[v_type]\n    k_writer = getattr(self, ktype_name)\n    v_writer = getattr(self, vtype_name)\n    self.writeMapBegin(k_type, v_type, len(val))\n    for m_key, m_val in val.iteritems():\n      if not k_is_container:\n        k_writer(m_key)\n      else:\n        k_writer(m_key, spec[1])\n      if not v_is_container:\n        v_writer(m_val)\n      else:\n        v_writer(m_val, spec[3])\n    self.writeMapEnd()\n\n  def writeStruct(self, obj, thrift_spec):\n    self.writeStructBegin(obj.__class__.__name__)\n    for field in thrift_spec:\n      if field is None:\n        continue\n      fname = field[2]\n      val = getattr(obj, fname)\n      if val is None:\n        # skip writing out unset fields\n        continue\n      fid = field[0]\n      ftype = field[1]\n      fspec = field[3]\n      # get the writer method for this value\n      self.writeFieldBegin(fname, ftype, fid)\n      self.writeFieldByTType(ftype, val, fspec)\n      self.writeFieldEnd()\n    self.writeFieldStop()\n    self.writeStructEnd()\n\n  def writeFieldByTType(self, ttype, val, spec):\n    r_handler, w_handler, is_container = self._TTYPE_HANDLERS[ttype]\n    writer = getattr(self, w_handler)\n    if is_container:\n      writer(val, spec)\n    else:\n      writer(val)\n\nclass TProtocolFactory:\n  def getProtocol(self, trans):\n    pass\n\n"
  },
  {
    "path": "lib/thrift/protocol/__init__.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\n__all__ = ['TProtocol', 'TBinaryProtocol', 'fastbinary', 'TBase']\n"
  },
  {
    "path": "lib/thrift/protocol/fastbinary.c",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n#include <Python.h>\n#include \"cStringIO.h\"\n#include <stdint.h>\n#ifndef _WIN32\n# include <stdbool.h>\n# include <netinet/in.h>\n#else\n# include <WinSock2.h>\n# pragma comment (lib, \"ws2_32.lib\")\n# define BIG_ENDIAN (4321)\n# define LITTLE_ENDIAN (1234)\n# define BYTE_ORDER LITTLE_ENDIAN\n# if defined(_MSC_VER) && _MSC_VER < 1600\n   typedef int _Bool;\n#  define bool _Bool\n#  define false 0 \n#  define true 1\n# endif\n# define inline __inline\n#endif\n\n/* Fix endianness issues on Solaris */\n#if defined (__SVR4) && defined (__sun)\n #if defined(__i386) && !defined(__i386__)\n  #define __i386__\n #endif\n\n #ifndef BIG_ENDIAN\n  #define BIG_ENDIAN (4321)\n #endif\n #ifndef LITTLE_ENDIAN\n  #define LITTLE_ENDIAN (1234)\n #endif\n\n /* I386 is LE, even on Solaris */\n #if !defined(BYTE_ORDER) && defined(__i386__)\n  #define BYTE_ORDER LITTLE_ENDIAN\n #endif\n#endif\n\n// TODO(dreiss): defval appears to be unused.  Look into removing it.\n// TODO(dreiss): Make parse_spec_args recursive, and cache the output\n//               permanently in the object.  (Malloc and orphan.)\n// TODO(dreiss): Why do we need cStringIO for reading, why not just char*?\n//               Can cStringIO let us work with a BufferedTransport?\n// TODO(dreiss): Don't ignore the rv from cwrite (maybe).\n\n/* ====== BEGIN UTILITIES ====== */\n\n#define INIT_OUTBUF_SIZE 128\n\n// Stolen out of TProtocol.h.\n// It would be a huge pain to have both get this from one place.\ntypedef enum TType {\n  T_STOP       = 0,\n  T_VOID       = 1,\n  T_BOOL       = 2,\n  T_BYTE       = 3,\n  T_I08        = 3,\n  T_I16        = 6,\n  T_I32        = 8,\n  T_U64        = 9,\n  T_I64        = 10,\n  T_DOUBLE     = 4,\n  T_STRING     = 11,\n  T_UTF7       = 11,\n  T_STRUCT     = 12,\n  T_MAP        = 13,\n  T_SET        = 14,\n  T_LIST       = 15,\n  T_UTF8       = 16,\n  T_UTF16      = 17\n} TType;\n\n#ifndef __BYTE_ORDER\n# if defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)\n#  define __BYTE_ORDER BYTE_ORDER\n#  define __LITTLE_ENDIAN LITTLE_ENDIAN\n#  define __BIG_ENDIAN BIG_ENDIAN\n# else\n#  error \"Cannot determine endianness\"\n# endif\n#endif\n\n// Same comment as the enum.  Sorry.\n#if __BYTE_ORDER == __BIG_ENDIAN\n# define ntohll(n) (n)\n# define htonll(n) (n)\n#elif __BYTE_ORDER == __LITTLE_ENDIAN\n# if defined(__GNUC__) && defined(__GLIBC__)\n#  include <byteswap.h>\n#  define ntohll(n) bswap_64(n)\n#  define htonll(n) bswap_64(n)\n# else /* GNUC & GLIBC */\n#  define ntohll(n) ( (((unsigned long long)ntohl(n)) << 32) + ntohl(n >> 32) )\n#  define htonll(n) ( (((unsigned long long)htonl(n)) << 32) + htonl(n >> 32) )\n# endif /* GNUC & GLIBC */\n#else /* __BYTE_ORDER */\n# error \"Can't define htonll or ntohll!\"\n#endif\n\n// Doing a benchmark shows that interning actually makes a difference, amazingly.\n#define INTERN_STRING(value) _intern_ ## value\n\n#define INT_CONV_ERROR_OCCURRED(v) ( ((v) == -1) && PyErr_Occurred() )\n#define CHECK_RANGE(v, min, max) ( ((v) <= (max)) && ((v) >= (min)) )\n\n// Py_ssize_t was not defined before Python 2.5\n#if (PY_VERSION_HEX < 0x02050000)\ntypedef int Py_ssize_t;\n#endif\n\n/**\n * A cache of the spec_args for a set or list,\n * so we don't have to keep calling PyTuple_GET_ITEM.\n */\ntypedef struct {\n  TType element_type;\n  PyObject* typeargs;\n} SetListTypeArgs;\n\n/**\n * A cache of the spec_args for a map,\n * so we don't have to keep calling PyTuple_GET_ITEM.\n */\ntypedef struct {\n  TType ktag;\n  TType vtag;\n  PyObject* ktypeargs;\n  PyObject* vtypeargs;\n} MapTypeArgs;\n\n/**\n * A cache of the spec_args for a struct,\n * so we don't have to keep calling PyTuple_GET_ITEM.\n */\ntypedef struct {\n  PyObject* klass;\n  PyObject* spec;\n} StructTypeArgs;\n\n/**\n * A cache of the item spec from a struct specification,\n * so we don't have to keep calling PyTuple_GET_ITEM.\n */\ntypedef struct {\n  int tag;\n  TType type;\n  PyObject* attrname;\n  PyObject* typeargs;\n  PyObject* defval;\n} StructItemSpec;\n\n/**\n * A cache of the two key attributes of a CReadableTransport,\n * so we don't have to keep calling PyObject_GetAttr.\n */\ntypedef struct {\n  PyObject* stringiobuf;\n  PyObject* refill_callable;\n} DecodeBuffer;\n\n/** Pointer to interned string to speed up attribute lookup. */\nstatic PyObject* INTERN_STRING(cstringio_buf);\n/** Pointer to interned string to speed up attribute lookup. */\nstatic PyObject* INTERN_STRING(cstringio_refill);\n\nstatic inline bool\ncheck_ssize_t_32(Py_ssize_t len) {\n  // error from getting the int\n  if (INT_CONV_ERROR_OCCURRED(len)) {\n    return false;\n  }\n  if (!CHECK_RANGE(len, 0, INT32_MAX)) {\n    PyErr_SetString(PyExc_OverflowError, \"string size out of range\");\n    return false;\n  }\n  return true;\n}\n\nstatic inline bool\nparse_pyint(PyObject* o, int32_t* ret, int32_t min, int32_t max) {\n  long val = PyInt_AsLong(o);\n\n  if (INT_CONV_ERROR_OCCURRED(val)) {\n    return false;\n  }\n  if (!CHECK_RANGE(val, min, max)) {\n    PyErr_SetString(PyExc_OverflowError, \"int out of range\");\n    return false;\n  }\n\n  *ret = (int32_t) val;\n  return true;\n}\n\n\n/* --- FUNCTIONS TO PARSE STRUCT SPECIFICATOINS --- */\n\nstatic bool\nparse_set_list_args(SetListTypeArgs* dest, PyObject* typeargs) {\n  if (PyTuple_Size(typeargs) != 2) {\n    PyErr_SetString(PyExc_TypeError, \"expecting tuple of size 2 for list/set type args\");\n    return false;\n  }\n\n  dest->element_type = PyInt_AsLong(PyTuple_GET_ITEM(typeargs, 0));\n  if (INT_CONV_ERROR_OCCURRED(dest->element_type)) {\n    return false;\n  }\n\n  dest->typeargs = PyTuple_GET_ITEM(typeargs, 1);\n\n  return true;\n}\n\nstatic bool\nparse_map_args(MapTypeArgs* dest, PyObject* typeargs) {\n  if (PyTuple_Size(typeargs) != 4) {\n    PyErr_SetString(PyExc_TypeError, \"expecting 4 arguments for typeargs to map\");\n    return false;\n  }\n\n  dest->ktag = PyInt_AsLong(PyTuple_GET_ITEM(typeargs, 0));\n  if (INT_CONV_ERROR_OCCURRED(dest->ktag)) {\n    return false;\n  }\n\n  dest->vtag = PyInt_AsLong(PyTuple_GET_ITEM(typeargs, 2));\n  if (INT_CONV_ERROR_OCCURRED(dest->vtag)) {\n    return false;\n  }\n\n  dest->ktypeargs = PyTuple_GET_ITEM(typeargs, 1);\n  dest->vtypeargs = PyTuple_GET_ITEM(typeargs, 3);\n\n  return true;\n}\n\nstatic bool\nparse_struct_args(StructTypeArgs* dest, PyObject* typeargs) {\n  if (PyTuple_Size(typeargs) != 2) {\n    PyErr_SetString(PyExc_TypeError, \"expecting tuple of size 2 for struct args\");\n    return false;\n  }\n\n  dest->klass = PyTuple_GET_ITEM(typeargs, 0);\n  dest->spec = PyTuple_GET_ITEM(typeargs, 1);\n\n  return true;\n}\n\nstatic int\nparse_struct_item_spec(StructItemSpec* dest, PyObject* spec_tuple) {\n\n  // i'd like to use ParseArgs here, but it seems to be a bottleneck.\n  if (PyTuple_Size(spec_tuple) != 5) {\n    PyErr_SetString(PyExc_TypeError, \"expecting 5 arguments for spec tuple\");\n    return false;\n  }\n\n  dest->tag = PyInt_AsLong(PyTuple_GET_ITEM(spec_tuple, 0));\n  if (INT_CONV_ERROR_OCCURRED(dest->tag)) {\n    return false;\n  }\n\n  dest->type = PyInt_AsLong(PyTuple_GET_ITEM(spec_tuple, 1));\n  if (INT_CONV_ERROR_OCCURRED(dest->type)) {\n    return false;\n  }\n\n  dest->attrname = PyTuple_GET_ITEM(spec_tuple, 2);\n  dest->typeargs = PyTuple_GET_ITEM(spec_tuple, 3);\n  dest->defval = PyTuple_GET_ITEM(spec_tuple, 4);\n  return true;\n}\n\n/* ====== END UTILITIES ====== */\n\n\n/* ====== BEGIN WRITING FUNCTIONS ====== */\n\n/* --- LOW-LEVEL WRITING FUNCTIONS --- */\n\nstatic void writeByte(PyObject* outbuf, int8_t val) {\n  int8_t net = val;\n  PycStringIO->cwrite(outbuf, (char*)&net, sizeof(int8_t));\n}\n\nstatic void writeI16(PyObject* outbuf, int16_t val) {\n  int16_t net = (int16_t)htons(val);\n  PycStringIO->cwrite(outbuf, (char*)&net, sizeof(int16_t));\n}\n\nstatic void writeI32(PyObject* outbuf, int32_t val) {\n  int32_t net = (int32_t)htonl(val);\n  PycStringIO->cwrite(outbuf, (char*)&net, sizeof(int32_t));\n}\n\nstatic void writeI64(PyObject* outbuf, int64_t val) {\n  int64_t net = (int64_t)htonll(val);\n  PycStringIO->cwrite(outbuf, (char*)&net, sizeof(int64_t));\n}\n\nstatic void writeDouble(PyObject* outbuf, double dub) {\n  // Unfortunately, bitwise_cast doesn't work in C.  Bad C!\n  union {\n    double f;\n    int64_t t;\n  } transfer;\n  transfer.f = dub;\n  writeI64(outbuf, transfer.t);\n}\n\n\n/* --- MAIN RECURSIVE OUTPUT FUCNTION -- */\n\nstatic int\noutput_val(PyObject* output, PyObject* value, TType type, PyObject* typeargs) {\n  /*\n   * Refcounting Strategy:\n   *\n   * We assume that elements of the thrift_spec tuple are not going to be\n   * mutated, so we don't ref count those at all. Other than that, we try to\n   * keep a reference to all the user-created objects while we work with them.\n   * output_val assumes that a reference is already held. The *caller* is\n   * responsible for handling references\n   */\n\n  switch (type) {\n\n  case T_BOOL: {\n    int v = PyObject_IsTrue(value);\n    if (v == -1) {\n      return false;\n    }\n\n    writeByte(output, (int8_t) v);\n    break;\n  }\n  case T_I08: {\n    int32_t val;\n\n    if (!parse_pyint(value, &val, INT8_MIN, INT8_MAX)) {\n      return false;\n    }\n\n    writeByte(output, (int8_t) val);\n    break;\n  }\n  case T_I16: {\n    int32_t val;\n\n    if (!parse_pyint(value, &val, INT16_MIN, INT16_MAX)) {\n      return false;\n    }\n\n    writeI16(output, (int16_t) val);\n    break;\n  }\n  case T_I32: {\n    int32_t val;\n\n    if (!parse_pyint(value, &val, INT32_MIN, INT32_MAX)) {\n      return false;\n    }\n\n    writeI32(output, val);\n    break;\n  }\n  case T_I64: {\n    int64_t nval = PyLong_AsLongLong(value);\n\n    if (INT_CONV_ERROR_OCCURRED(nval)) {\n      return false;\n    }\n\n    if (!CHECK_RANGE(nval, INT64_MIN, INT64_MAX)) {\n      PyErr_SetString(PyExc_OverflowError, \"int out of range\");\n      return false;\n    }\n\n    writeI64(output, nval);\n    break;\n  }\n\n  case T_DOUBLE: {\n    double nval = PyFloat_AsDouble(value);\n    if (nval == -1.0 && PyErr_Occurred()) {\n      return false;\n    }\n\n    writeDouble(output, nval);\n    break;\n  }\n\n  case T_STRING: {\n    Py_ssize_t len = PyString_Size(value);\n\n    if (!check_ssize_t_32(len)) {\n      return false;\n    }\n\n    writeI32(output, (int32_t) len);\n    PycStringIO->cwrite(output, PyString_AsString(value), (int32_t) len);\n    break;\n  }\n\n  case T_LIST:\n  case T_SET: {\n    Py_ssize_t len;\n    SetListTypeArgs parsedargs;\n    PyObject *item;\n    PyObject *iterator;\n\n    if (!parse_set_list_args(&parsedargs, typeargs)) {\n      return false;\n    }\n\n    len = PyObject_Length(value);\n\n    if (!check_ssize_t_32(len)) {\n      return false;\n    }\n\n    writeByte(output, parsedargs.element_type);\n    writeI32(output, (int32_t) len);\n\n    iterator =  PyObject_GetIter(value);\n    if (iterator == NULL) {\n      return false;\n    }\n\n    while ((item = PyIter_Next(iterator))) {\n      if (!output_val(output, item, parsedargs.element_type, parsedargs.typeargs)) {\n        Py_DECREF(item);\n        Py_DECREF(iterator);\n        return false;\n      }\n      Py_DECREF(item);\n    }\n\n    Py_DECREF(iterator);\n\n    if (PyErr_Occurred()) {\n      return false;\n    }\n\n    break;\n  }\n\n  case T_MAP: {\n    PyObject *k, *v;\n    Py_ssize_t pos = 0;\n    Py_ssize_t len;\n\n    MapTypeArgs parsedargs;\n\n    len = PyDict_Size(value);\n    if (!check_ssize_t_32(len)) {\n      return false;\n    }\n\n    if (!parse_map_args(&parsedargs, typeargs)) {\n      return false;\n    }\n\n    writeByte(output, parsedargs.ktag);\n    writeByte(output, parsedargs.vtag);\n    writeI32(output, len);\n\n    // TODO(bmaurer): should support any mapping, not just dicts\n    while (PyDict_Next(value, &pos, &k, &v)) {\n      // TODO(dreiss): Think hard about whether these INCREFs actually\n      //               turn any unsafe scenarios into safe scenarios.\n      Py_INCREF(k);\n      Py_INCREF(v);\n\n      if (!output_val(output, k, parsedargs.ktag, parsedargs.ktypeargs)\n          || !output_val(output, v, parsedargs.vtag, parsedargs.vtypeargs)) {\n        Py_DECREF(k);\n        Py_DECREF(v);\n        return false;\n      }\n      Py_DECREF(k);\n      Py_DECREF(v);\n    }\n    break;\n  }\n\n  // TODO(dreiss): Consider breaking this out as a function\n  //               the way we did for decode_struct.\n  case T_STRUCT: {\n    StructTypeArgs parsedargs;\n    Py_ssize_t nspec;\n    Py_ssize_t i;\n\n    if (!parse_struct_args(&parsedargs, typeargs)) {\n      return false;\n    }\n\n    nspec = PyTuple_Size(parsedargs.spec);\n\n    if (nspec == -1) {\n      return false;\n    }\n\n    for (i = 0; i < nspec; i++) {\n      StructItemSpec parsedspec;\n      PyObject* spec_tuple;\n      PyObject* instval = NULL;\n\n      spec_tuple = PyTuple_GET_ITEM(parsedargs.spec, i);\n      if (spec_tuple == Py_None) {\n        continue;\n      }\n\n      if (!parse_struct_item_spec (&parsedspec, spec_tuple)) {\n        return false;\n      }\n\n      instval = PyObject_GetAttr(value, parsedspec.attrname);\n\n      if (!instval) {\n        return false;\n      }\n\n      if (instval == Py_None) {\n        Py_DECREF(instval);\n        continue;\n      }\n\n      writeByte(output, (int8_t) parsedspec.type);\n      writeI16(output, parsedspec.tag);\n\n      if (!output_val(output, instval, parsedspec.type, parsedspec.typeargs)) {\n        Py_DECREF(instval);\n        return false;\n      }\n\n      Py_DECREF(instval);\n    }\n\n    writeByte(output, (int8_t)T_STOP);\n    break;\n  }\n\n  case T_STOP:\n  case T_VOID:\n  case T_UTF16:\n  case T_UTF8:\n  case T_U64:\n  default:\n    PyErr_SetString(PyExc_TypeError, \"Unexpected TType\");\n    return false;\n\n  }\n\n  return true;\n}\n\n\n/* --- TOP-LEVEL WRAPPER FOR OUTPUT -- */\n\nstatic PyObject *\nencode_binary(PyObject *self, PyObject *args) {\n  PyObject* enc_obj;\n  PyObject* type_args;\n  PyObject* buf;\n  PyObject* ret = NULL;\n\n  if (!PyArg_ParseTuple(args, \"OO\", &enc_obj, &type_args)) {\n    return NULL;\n  }\n\n  buf = PycStringIO->NewOutput(INIT_OUTBUF_SIZE);\n  if (output_val(buf, enc_obj, T_STRUCT, type_args)) {\n    ret = PycStringIO->cgetvalue(buf);\n  }\n\n  Py_DECREF(buf);\n  return ret;\n}\n\n/* ====== END WRITING FUNCTIONS ====== */\n\n\n/* ====== BEGIN READING FUNCTIONS ====== */\n\n/* --- LOW-LEVEL READING FUNCTIONS --- */\n\nstatic void\nfree_decodebuf(DecodeBuffer* d) {\n  Py_XDECREF(d->stringiobuf);\n  Py_XDECREF(d->refill_callable);\n}\n\nstatic bool\ndecode_buffer_from_obj(DecodeBuffer* dest, PyObject* obj) {\n  dest->stringiobuf = PyObject_GetAttr(obj, INTERN_STRING(cstringio_buf));\n  if (!dest->stringiobuf) {\n    return false;\n  }\n\n  if (!PycStringIO_InputCheck(dest->stringiobuf)) {\n    free_decodebuf(dest);\n    PyErr_SetString(PyExc_TypeError, \"expecting stringio input\");\n    return false;\n  }\n\n  dest->refill_callable = PyObject_GetAttr(obj, INTERN_STRING(cstringio_refill));\n\n  if(!dest->refill_callable) {\n    free_decodebuf(dest);\n    return false;\n  }\n\n  if (!PyCallable_Check(dest->refill_callable)) {\n    free_decodebuf(dest);\n    PyErr_SetString(PyExc_TypeError, \"expecting callable\");\n    return false;\n  }\n\n  return true;\n}\n\nstatic bool readBytes(DecodeBuffer* input, char** output, int len) {\n  int read;\n\n  // TODO(dreiss): Don't fear the malloc.  Think about taking a copy of\n  //               the partial read instead of forcing the transport\n  //               to prepend it to its buffer.\n\n  read = PycStringIO->cread(input->stringiobuf, output, len);\n\n  if (read == len) {\n    return true;\n  } else if (read == -1) {\n    return false;\n  } else {\n    PyObject* newiobuf;\n\n    // using building functions as this is a rare codepath\n    newiobuf = PyObject_CallFunction(\n        input->refill_callable, \"s#i\", *output, read, len, NULL);\n    if (newiobuf == NULL) {\n      return false;\n    }\n\n    // must do this *AFTER* the call so that we don't deref the io buffer\n    Py_CLEAR(input->stringiobuf);\n    input->stringiobuf = newiobuf;\n\n    read = PycStringIO->cread(input->stringiobuf, output, len);\n\n    if (read == len) {\n      return true;\n    } else if (read == -1) {\n      return false;\n    } else {\n      // TODO(dreiss): This could be a valid code path for big binary blobs.\n      PyErr_SetString(PyExc_TypeError,\n          \"refill claimed to have refilled the buffer, but didn't!!\");\n      return false;\n    }\n  }\n}\n\nstatic int8_t readByte(DecodeBuffer* input) {\n  char* buf;\n  if (!readBytes(input, &buf, sizeof(int8_t))) {\n    return -1;\n  }\n\n  return *(int8_t*) buf;\n}\n\nstatic int16_t readI16(DecodeBuffer* input) {\n  char* buf;\n  if (!readBytes(input, &buf, sizeof(int16_t))) {\n    return -1;\n  }\n\n  return (int16_t) ntohs(*(int16_t*) buf);\n}\n\nstatic int32_t readI32(DecodeBuffer* input) {\n  char* buf;\n  if (!readBytes(input, &buf, sizeof(int32_t))) {\n    return -1;\n  }\n  return (int32_t) ntohl(*(int32_t*) buf);\n}\n\n\nstatic int64_t readI64(DecodeBuffer* input) {\n  char* buf;\n  if (!readBytes(input, &buf, sizeof(int64_t))) {\n    return -1;\n  }\n\n  return (int64_t) ntohll(*(int64_t*) buf);\n}\n\nstatic double readDouble(DecodeBuffer* input) {\n  union {\n    int64_t f;\n    double t;\n  } transfer;\n\n  transfer.f = readI64(input);\n  if (transfer.f == -1) {\n    return -1;\n  }\n  return transfer.t;\n}\n\nstatic bool\ncheckTypeByte(DecodeBuffer* input, TType expected) {\n  TType got = readByte(input);\n  if (INT_CONV_ERROR_OCCURRED(got)) {\n    return false;\n  }\n\n  if (expected != got) {\n    PyErr_SetString(PyExc_TypeError, \"got wrong ttype while reading field\");\n    return false;\n  }\n  return true;\n}\n\nstatic bool\nskip(DecodeBuffer* input, TType type) {\n#define SKIPBYTES(n) \\\n  do { \\\n    if (!readBytes(input, &dummy_buf, (n))) { \\\n      return false; \\\n    } \\\n  } while(0)\n\n  char* dummy_buf;\n\n  switch (type) {\n\n  case T_BOOL:\n  case T_I08: SKIPBYTES(1); break;\n  case T_I16: SKIPBYTES(2); break;\n  case T_I32: SKIPBYTES(4); break;\n  case T_I64:\n  case T_DOUBLE: SKIPBYTES(8); break;\n\n  case T_STRING: {\n    // TODO(dreiss): Find out if these check_ssize_t32s are really necessary.\n    int len = readI32(input);\n    if (!check_ssize_t_32(len)) {\n      return false;\n    }\n    SKIPBYTES(len);\n    break;\n  }\n\n  case T_LIST:\n  case T_SET: {\n    TType etype;\n    int len, i;\n\n    etype = readByte(input);\n    if (etype == -1) {\n      return false;\n    }\n\n    len = readI32(input);\n    if (!check_ssize_t_32(len)) {\n      return false;\n    }\n\n    for (i = 0; i < len; i++) {\n      if (!skip(input, etype)) {\n        return false;\n      }\n    }\n    break;\n  }\n\n  case T_MAP: {\n    TType ktype, vtype;\n    int len, i;\n\n    ktype = readByte(input);\n    if (ktype == -1) {\n      return false;\n    }\n\n    vtype = readByte(input);\n    if (vtype == -1) {\n      return false;\n    }\n\n    len = readI32(input);\n    if (!check_ssize_t_32(len)) {\n      return false;\n    }\n\n    for (i = 0; i < len; i++) {\n      if (!(skip(input, ktype) && skip(input, vtype))) {\n        return false;\n      }\n    }\n    break;\n  }\n\n  case T_STRUCT: {\n    while (true) {\n      TType type;\n\n      type = readByte(input);\n      if (type == -1) {\n        return false;\n      }\n\n      if (type == T_STOP)\n        break;\n\n      SKIPBYTES(2); // tag\n      if (!skip(input, type)) {\n        return false;\n      }\n    }\n    break;\n  }\n\n  case T_STOP:\n  case T_VOID:\n  case T_UTF16:\n  case T_UTF8:\n  case T_U64:\n  default:\n    PyErr_SetString(PyExc_TypeError, \"Unexpected TType\");\n    return false;\n\n  }\n\n  return true;\n\n#undef SKIPBYTES\n}\n\n\n/* --- HELPER FUNCTION FOR DECODE_VAL --- */\n\nstatic PyObject*\ndecode_val(DecodeBuffer* input, TType type, PyObject* typeargs);\n\nstatic bool\ndecode_struct(DecodeBuffer* input, PyObject* output, PyObject* spec_seq) {\n  int spec_seq_len = PyTuple_Size(spec_seq);\n  if (spec_seq_len == -1) {\n    return false;\n  }\n\n  while (true) {\n    TType type;\n    int16_t tag;\n    PyObject* item_spec;\n    PyObject* fieldval = NULL;\n    StructItemSpec parsedspec;\n\n    type = readByte(input);\n    if (type == -1) {\n      return false;\n    }\n    if (type == T_STOP) {\n      break;\n    }\n    tag = readI16(input);\n    if (INT_CONV_ERROR_OCCURRED(tag)) {\n      return false;\n    }\n    if (tag >= 0 && tag < spec_seq_len) {\n      item_spec = PyTuple_GET_ITEM(spec_seq, tag);\n    } else {\n      item_spec = Py_None;\n    }\n\n    if (item_spec == Py_None) {\n      if (!skip(input, type)) {\n        return false;\n      } else {\n        continue;\n      }\n    }\n\n    if (!parse_struct_item_spec(&parsedspec, item_spec)) {\n      return false;\n    }\n    if (parsedspec.type != type) {\n      if (!skip(input, type)) {\n        PyErr_SetString(PyExc_TypeError, \"struct field had wrong type while reading and can't be skipped\");\n        return false;\n      } else {\n        continue;\n      }\n    }\n\n    fieldval = decode_val(input, parsedspec.type, parsedspec.typeargs);\n    if (fieldval == NULL) {\n      return false;\n    }\n\n    if (PyObject_SetAttr(output, parsedspec.attrname, fieldval) == -1) {\n      Py_DECREF(fieldval);\n      return false;\n    }\n    Py_DECREF(fieldval);\n  }\n  return true;\n}\n\n\n/* --- MAIN RECURSIVE INPUT FUCNTION --- */\n\n// Returns a new reference.\nstatic PyObject*\ndecode_val(DecodeBuffer* input, TType type, PyObject* typeargs) {\n  switch (type) {\n\n  case T_BOOL: {\n    int8_t v = readByte(input);\n    if (INT_CONV_ERROR_OCCURRED(v)) {\n      return NULL;\n    }\n\n    switch (v) {\n    case 0: Py_RETURN_FALSE;\n    case 1: Py_RETURN_TRUE;\n    // Don't laugh.  This is a potentially serious issue.\n    default: PyErr_SetString(PyExc_TypeError, \"boolean out of range\"); return NULL;\n    }\n    break;\n  }\n  case T_I08: {\n    int8_t v = readByte(input);\n    if (INT_CONV_ERROR_OCCURRED(v)) {\n      return NULL;\n    }\n\n    return PyInt_FromLong(v);\n  }\n  case T_I16: {\n    int16_t v = readI16(input);\n    if (INT_CONV_ERROR_OCCURRED(v)) {\n      return NULL;\n    }\n    return PyInt_FromLong(v);\n  }\n  case T_I32: {\n    int32_t v = readI32(input);\n    if (INT_CONV_ERROR_OCCURRED(v)) {\n      return NULL;\n    }\n    return PyInt_FromLong(v);\n  }\n\n  case T_I64: {\n    int64_t v = readI64(input);\n    if (INT_CONV_ERROR_OCCURRED(v)) {\n      return NULL;\n    }\n    // TODO(dreiss): Find out if we can take this fastpath always when\n    //               sizeof(long) == sizeof(long long).\n    if (CHECK_RANGE(v, LONG_MIN, LONG_MAX)) {\n      return PyInt_FromLong((long) v);\n    }\n\n    return PyLong_FromLongLong(v);\n  }\n\n  case T_DOUBLE: {\n    double v = readDouble(input);\n    if (v == -1.0 && PyErr_Occurred()) {\n      return false;\n    }\n    return PyFloat_FromDouble(v);\n  }\n\n  case T_STRING: {\n    Py_ssize_t len = readI32(input);\n    char* buf;\n    if (!readBytes(input, &buf, len)) {\n      return NULL;\n    }\n\n    return PyString_FromStringAndSize(buf, len);\n  }\n\n  case T_LIST:\n  case T_SET: {\n    SetListTypeArgs parsedargs;\n    int32_t len;\n    PyObject* ret = NULL;\n    int i;\n\n    if (!parse_set_list_args(&parsedargs, typeargs)) {\n      return NULL;\n    }\n\n    if (!checkTypeByte(input, parsedargs.element_type)) {\n      return NULL;\n    }\n\n    len = readI32(input);\n    if (!check_ssize_t_32(len)) {\n      return NULL;\n    }\n\n    ret = PyList_New(len);\n    if (!ret) {\n      return NULL;\n    }\n\n    for (i = 0; i < len; i++) {\n      PyObject* item = decode_val(input, parsedargs.element_type, parsedargs.typeargs);\n      if (!item) {\n        Py_DECREF(ret);\n        return NULL;\n      }\n      PyList_SET_ITEM(ret, i, item);\n    }\n\n    // TODO(dreiss): Consider biting the bullet and making two separate cases\n    //               for list and set, avoiding this post facto conversion.\n    if (type == T_SET) {\n      PyObject* setret;\n#if (PY_VERSION_HEX < 0x02050000)\n      // hack needed for older versions\n      setret = PyObject_CallFunctionObjArgs((PyObject*)&PySet_Type, ret, NULL);\n#else\n      // official version\n      setret = PySet_New(ret);\n#endif\n      Py_DECREF(ret);\n      return setret;\n    }\n    return ret;\n  }\n\n  case T_MAP: {\n    int32_t len;\n    int i;\n    MapTypeArgs parsedargs;\n    PyObject* ret = NULL;\n\n    if (!parse_map_args(&parsedargs, typeargs)) {\n      return NULL;\n    }\n\n    if (!checkTypeByte(input, parsedargs.ktag)) {\n      return NULL;\n    }\n    if (!checkTypeByte(input, parsedargs.vtag)) {\n      return NULL;\n    }\n\n    len = readI32(input);\n    if (!check_ssize_t_32(len)) {\n      return false;\n    }\n\n    ret = PyDict_New();\n    if (!ret) {\n      goto error;\n    }\n\n    for (i = 0; i < len; i++) {\n      PyObject* k = NULL;\n      PyObject* v = NULL;\n      k = decode_val(input, parsedargs.ktag, parsedargs.ktypeargs);\n      if (k == NULL) {\n        goto loop_error;\n      }\n      v = decode_val(input, parsedargs.vtag, parsedargs.vtypeargs);\n      if (v == NULL) {\n        goto loop_error;\n      }\n      if (PyDict_SetItem(ret, k, v) == -1) {\n        goto loop_error;\n      }\n\n      Py_DECREF(k);\n      Py_DECREF(v);\n      continue;\n\n      // Yuck!  Destructors, anyone?\n      loop_error:\n      Py_XDECREF(k);\n      Py_XDECREF(v);\n      goto error;\n    }\n\n    return ret;\n\n    error:\n    Py_XDECREF(ret);\n    return NULL;\n  }\n\n  case T_STRUCT: {\n    StructTypeArgs parsedargs;\n\tPyObject* ret;\n    if (!parse_struct_args(&parsedargs, typeargs)) {\n      return NULL;\n    }\n\n    ret = PyObject_CallObject(parsedargs.klass, NULL);\n    if (!ret) {\n      return NULL;\n    }\n\n    if (!decode_struct(input, ret, parsedargs.spec)) {\n      Py_DECREF(ret);\n      return NULL;\n    }\n\n    return ret;\n  }\n\n  case T_STOP:\n  case T_VOID:\n  case T_UTF16:\n  case T_UTF8:\n  case T_U64:\n  default:\n    PyErr_SetString(PyExc_TypeError, \"Unexpected TType\");\n    return NULL;\n  }\n}\n\n\n/* --- TOP-LEVEL WRAPPER FOR INPUT -- */\n\nstatic PyObject*\ndecode_binary(PyObject *self, PyObject *args) {\n  PyObject* output_obj = NULL;\n  PyObject* transport = NULL;\n  PyObject* typeargs = NULL;\n  StructTypeArgs parsedargs;\n  DecodeBuffer input = {0, 0};\n  \n  if (!PyArg_ParseTuple(args, \"OOO\", &output_obj, &transport, &typeargs)) {\n    return NULL;\n  }\n\n  if (!parse_struct_args(&parsedargs, typeargs)) {\n    return NULL;\n  }\n\n  if (!decode_buffer_from_obj(&input, transport)) {\n    return NULL;\n  }\n\n  if (!decode_struct(&input, output_obj, parsedargs.spec)) {\n    free_decodebuf(&input);\n    return NULL;\n  }\n\n  free_decodebuf(&input);\n\n  Py_RETURN_NONE;\n}\n\n/* ====== END READING FUNCTIONS ====== */\n\n\n/* -- PYTHON MODULE SETUP STUFF --- */\n\nstatic PyMethodDef ThriftFastBinaryMethods[] = {\n\n  {\"encode_binary\",  encode_binary, METH_VARARGS, \"\"},\n  {\"decode_binary\",  decode_binary, METH_VARARGS, \"\"},\n\n  {NULL, NULL, 0, NULL}        /* Sentinel */\n};\n\nPyMODINIT_FUNC\ninitfastbinary(void) {\n#define INIT_INTERN_STRING(value) \\\n  do { \\\n    INTERN_STRING(value) = PyString_InternFromString(#value); \\\n    if(!INTERN_STRING(value)) return; \\\n  } while(0)\n\n  INIT_INTERN_STRING(cstringio_buf);\n  INIT_INTERN_STRING(cstringio_refill);\n#undef INIT_INTERN_STRING\n\n  PycString_IMPORT;\n  if (PycStringIO == NULL) return;\n\n  (void) Py_InitModule(\"thrift.protocol.fastbinary\", ThriftFastBinaryMethods);\n}\n"
  },
  {
    "path": "lib/thrift/server/THttpServer.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\nimport BaseHTTPServer\n\nfrom thrift.server import TServer\nfrom thrift.transport import TTransport\n\nclass ResponseException(Exception):\n  \"\"\"Allows handlers to override the HTTP response\n\n  Normally, THttpServer always sends a 200 response.  If a handler wants\n  to override this behavior (e.g., to simulate a misconfigured or\n  overloaded web server during testing), it can raise a ResponseException.\n  The function passed to the constructor will be called with the\n  RequestHandler as its only argument.\n  \"\"\"\n  def __init__(self, handler):\n    self.handler = handler\n\n\nclass THttpServer(TServer.TServer):\n  \"\"\"A simple HTTP-based Thrift server\n\n  This class is not very performant, but it is useful (for example) for\n  acting as a mock version of an Apache-based PHP Thrift endpoint.\"\"\"\n\n  def __init__(self, processor, server_address,\n      inputProtocolFactory, outputProtocolFactory = None,\n      server_class = BaseHTTPServer.HTTPServer):\n    \"\"\"Set up protocol factories and HTTP server.\n\n    See BaseHTTPServer for server_address.\n    See TServer for protocol factories.\"\"\"\n\n    if outputProtocolFactory is None:\n      outputProtocolFactory = inputProtocolFactory\n\n    TServer.TServer.__init__(self, processor, None, None, None,\n        inputProtocolFactory, outputProtocolFactory)\n\n    thttpserver = self\n\n    class RequestHander(BaseHTTPServer.BaseHTTPRequestHandler):\n      def do_POST(self):\n        # Don't care about the request path.\n        itrans = TTransport.TFileObjectTransport(self.rfile)\n        otrans = TTransport.TFileObjectTransport(self.wfile)\n        itrans = TTransport.TBufferedTransport(itrans, int(self.headers['Content-Length']))\n        otrans = TTransport.TMemoryBuffer()\n        iprot = thttpserver.inputProtocolFactory.getProtocol(itrans)\n        oprot = thttpserver.outputProtocolFactory.getProtocol(otrans)\n        try:\n          thttpserver.processor.process(iprot, oprot)\n        except ResponseException, exn:\n          exn.handler(self)\n        else:\n          self.send_response(200)\n          self.send_header(\"content-type\", \"application/x-thrift\")\n          self.end_headers()\n          self.wfile.write(otrans.getvalue())\n\n    self.httpd = server_class(server_address, RequestHander)\n\n  def serve(self):\n    self.httpd.serve_forever()\n"
  },
  {
    "path": "lib/thrift/server/TNonblockingServer.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\"\"\"Implementation of non-blocking server.\n\nThe main idea of the server is reciving and sending requests\nonly from main thread.\n\nIt also makes thread pool server in tasks terms, not connections.\n\"\"\"\nimport threading\nimport socket\nimport Queue\nimport select\nimport struct\nimport logging\n\nfrom thrift.transport import TTransport\nfrom thrift.protocol.TBinaryProtocol import TBinaryProtocolFactory\n\n__all__ = ['TNonblockingServer']\n\nclass Worker(threading.Thread):\n    \"\"\"Worker is a small helper to process incoming connection.\"\"\"\n    def __init__(self, queue):\n        threading.Thread.__init__(self)\n        self.queue = queue\n\n    def run(self):\n        \"\"\"Process queries from task queue, stop if processor is None.\"\"\"\n        while True:\n            try:\n                processor, iprot, oprot, otrans, callback = self.queue.get()\n                if processor is None:\n                    break\n                processor.process(iprot, oprot)\n                callback(True, otrans.getvalue())\n            except Exception:\n                logging.exception(\"Exception while processing request\")\n                callback(False, '')\n\nWAIT_LEN = 0\nWAIT_MESSAGE = 1\nWAIT_PROCESS = 2\nSEND_ANSWER = 3\nCLOSED = 4\n\ndef locked(func):\n    \"Decorator which locks self.lock.\"\n    def nested(self, *args, **kwargs):\n        self.lock.acquire()\n        try:\n            return func(self, *args, **kwargs)\n        finally:\n            self.lock.release()\n    return nested\n\ndef socket_exception(func):\n    \"Decorator close object on socket.error.\"\n    def read(self, *args, **kwargs):\n        try:\n            return func(self, *args, **kwargs)\n        except socket.error:\n            self.close()\n    return read\n\nclass Connection:\n    \"\"\"Basic class is represented connection.\n    \n    It can be in state:\n        WAIT_LEN --- connection is reading request len.\n        WAIT_MESSAGE --- connection is reading request.\n        WAIT_PROCESS --- connection has just read whole request and \n            waits for call ready routine.\n        SEND_ANSWER --- connection is sending answer string (including length\n            of answer).\n        CLOSED --- socket was closed and connection should be deleted.\n    \"\"\"\n    def __init__(self, new_socket, wake_up):\n        self.socket = new_socket\n        self.socket.setblocking(False)\n        self.status = WAIT_LEN\n        self.len = 0\n        self.message = ''\n        self.lock = threading.Lock()\n        self.wake_up = wake_up\n\n    def _read_len(self):\n        \"\"\"Reads length of request.\n        \n        It's really paranoic routine and it may be replaced by \n        self.socket.recv(4).\"\"\"\n        read = self.socket.recv(4 - len(self.message))\n        if len(read) == 0:\n            # if we read 0 bytes and self.message is empty, it means client close \n            # connection\n            if len(self.message) != 0:\n                logging.error(\"can't read frame size from socket\")\n            self.close()\n            return\n        self.message += read\n        if len(self.message) == 4:\n            self.len, = struct.unpack('!i', self.message)\n            if self.len < 0:\n                logging.error(\"negative frame size, it seems client\"\\\n                    \" doesn't use FramedTransport\")\n                self.close()\n            elif self.len == 0:\n                logging.error(\"empty frame, it's really strange\")\n                self.close()\n            else:\n                self.message = ''\n                self.status = WAIT_MESSAGE\n\n    @socket_exception\n    def read(self):\n        \"\"\"Reads data from stream and switch state.\"\"\"\n        assert self.status in (WAIT_LEN, WAIT_MESSAGE)\n        if self.status == WAIT_LEN:\n            self._read_len()\n            # go back to the main loop here for simplicity instead of\n            # falling through, even though there is a good chance that\n            # the message is already available\n        elif self.status == WAIT_MESSAGE:\n            read = self.socket.recv(self.len - len(self.message))\n            if len(read) == 0:\n                logging.error(\"can't read frame from socket (get %d of %d bytes)\" %\n                    (len(self.message), self.len))\n                self.close()\n                return\n            self.message += read\n            if len(self.message) == self.len:\n                self.status = WAIT_PROCESS\n\n    @socket_exception\n    def write(self):\n        \"\"\"Writes data from socket and switch state.\"\"\"\n        assert self.status == SEND_ANSWER\n        sent = self.socket.send(self.message)\n        if sent == len(self.message):\n            self.status = WAIT_LEN\n            self.message = ''\n            self.len = 0\n        else:\n            self.message = self.message[sent:]\n\n    @locked\n    def ready(self, all_ok, message):\n        \"\"\"Callback function for switching state and waking up main thread.\n        \n        This function is the only function witch can be called asynchronous.\n        \n        The ready can switch Connection to three states:\n            WAIT_LEN if request was oneway.\n            SEND_ANSWER if request was processed in normal way.\n            CLOSED if request throws unexpected exception.\n        \n        The one wakes up main thread.\n        \"\"\"\n        assert self.status == WAIT_PROCESS\n        if not all_ok:\n            self.close()\n            self.wake_up()\n            return\n        self.len = ''\n        if len(message) == 0:\n            # it was a oneway request, do not write answer\n            self.message = ''\n            self.status = WAIT_LEN\n        else:\n            self.message = struct.pack('!i', len(message)) + message\n            self.status = SEND_ANSWER\n        self.wake_up()\n\n    @locked\n    def is_writeable(self):\n        \"Returns True if connection should be added to write list of select.\"\n        return self.status == SEND_ANSWER\n\n    # it's not necessary, but...\n    @locked\n    def is_readable(self):\n        \"Returns True if connection should be added to read list of select.\"\n        return self.status in (WAIT_LEN, WAIT_MESSAGE)\n\n    @locked\n    def is_closed(self):\n        \"Returns True if connection is closed.\"\n        return self.status == CLOSED\n\n    def fileno(self):\n        \"Returns the file descriptor of the associated socket.\"\n        return self.socket.fileno()\n\n    def close(self):\n        \"Closes connection\"\n        self.status = CLOSED\n        self.socket.close()\n\nclass TNonblockingServer:\n    \"\"\"Non-blocking server.\"\"\"\n    def __init__(self, processor, lsocket, inputProtocolFactory=None, \n            outputProtocolFactory=None, threads=10):\n        self.processor = processor\n        self.socket = lsocket\n        self.in_protocol = inputProtocolFactory or TBinaryProtocolFactory()\n        self.out_protocol = outputProtocolFactory or self.in_protocol\n        self.threads = int(threads)\n        self.clients = {}\n        self.tasks = Queue.Queue()\n        self._read, self._write = socket.socketpair()\n        self.prepared = False\n\n    def setNumThreads(self, num):\n        \"\"\"Set the number of worker threads that should be created.\"\"\"\n        # implement ThreadPool interface\n        assert not self.prepared, \"You can't change number of threads for working server\"\n        self.threads = num\n\n    def prepare(self):\n        \"\"\"Prepares server for serve requests.\"\"\"\n        self.socket.listen()\n        for _ in xrange(self.threads):\n            thread = Worker(self.tasks)\n            thread.setDaemon(True)\n            thread.start()\n        self.prepared = True\n\n    def wake_up(self):\n        \"\"\"Wake up main thread.\n        \n        The server usualy waits in select call in we should terminate one.\n        The simplest way is using socketpair.\n        \n        Select always wait to read from the first socket of socketpair.\n        \n        In this case, we can just write anything to the second socket from\n        socketpair.\"\"\"\n        self._write.send('1')\n\n    def _select(self):\n        \"\"\"Does select on open connections.\"\"\"\n        readable = [self.socket.handle.fileno(), self._read.fileno()]\n        writable = []\n        for i, connection in self.clients.items():\n            if connection.is_readable():\n                readable.append(connection.fileno())\n            if connection.is_writeable():\n                writable.append(connection.fileno())\n            if connection.is_closed():\n                del self.clients[i]\n        return select.select(readable, writable, readable)\n        \n    def handle(self):\n        \"\"\"Handle requests.\n       \n        WARNING! You must call prepare BEFORE calling handle.\n        \"\"\"\n        assert self.prepared, \"You have to call prepare before handle\"\n        rset, wset, xset = self._select()\n        for readable in rset:\n            if readable == self._read.fileno():\n                # don't care i just need to clean readable flag\n                self._read.recv(1024) \n            elif readable == self.socket.handle.fileno():\n                client = self.socket.accept().handle\n                self.clients[client.fileno()] = Connection(client, self.wake_up)\n            else:\n                connection = self.clients[readable]\n                connection.read()\n                if connection.status == WAIT_PROCESS:\n                    itransport = TTransport.TMemoryBuffer(connection.message)\n                    otransport = TTransport.TMemoryBuffer()\n                    iprot = self.in_protocol.getProtocol(itransport)\n                    oprot = self.out_protocol.getProtocol(otransport)\n                    self.tasks.put([self.processor, iprot, oprot, \n                                    otransport, connection.ready])\n        for writeable in wset:\n            self.clients[writeable].write()\n        for oob in xset:\n            self.clients[oob].close()\n            del self.clients[oob]\n\n    def close(self):\n        \"\"\"Closes the server.\"\"\"\n        for _ in xrange(self.threads):\n            self.tasks.put([None, None, None, None, None])\n        self.socket.close()\n        self.prepared = False\n        \n    def serve(self):\n        \"\"\"Serve forever.\"\"\"\n        self.prepare()\n        while True:\n            self.handle()\n"
  },
  {
    "path": "lib/thrift/server/TProcessPoolServer.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\n\nimport logging\nfrom multiprocessing import  Process, Value, Condition, reduction\n\nfrom TServer import TServer\nfrom thrift.transport.TTransport import TTransportException\n\nclass TProcessPoolServer(TServer):\n\n    \"\"\"\n    Server with a fixed size pool of worker subprocesses which service requests.\n    Note that if you need shared state between the handlers - it's up to you!\n    Written by Dvir Volk, doat.com\n    \"\"\"\n\n    def __init__(self, * args):\n        TServer.__init__(self, *args)\n        self.numWorkers = 10\n        self.workers = []\n        self.isRunning = Value('b', False)\n        self.stopCondition = Condition()\n        self.postForkCallback = None\n\n    def setPostForkCallback(self, callback):\n        if not callable(callback):\n            raise TypeError(\"This is not a callback!\")\n        self.postForkCallback = callback\n\n    def setNumWorkers(self, num):\n        \"\"\"Set the number of worker threads that should be created\"\"\"\n        self.numWorkers = num\n\n    def workerProcess(self):\n        \"\"\"Loop around getting clients from the shared queue and process them.\"\"\"\n\n        if self.postForkCallback:\n            self.postForkCallback()\n\n        while self.isRunning.value == True:\n            try:\n                client = self.serverTransport.accept()\n                self.serveClient(client)\n            except (KeyboardInterrupt, SystemExit):\n                return 0\n            except Exception, x:\n                logging.exception(x)\n\n    def serveClient(self, client):\n        \"\"\"Process input/output from a client for as long as possible\"\"\"\n        itrans = self.inputTransportFactory.getTransport(client)\n        otrans = self.outputTransportFactory.getTransport(client)\n        iprot = self.inputProtocolFactory.getProtocol(itrans)\n        oprot = self.outputProtocolFactory.getProtocol(otrans)\n\n        try:\n            while True:\n                self.processor.process(iprot, oprot)\n        except TTransportException, tx:\n            pass\n        except Exception, x:\n            logging.exception(x)\n\n        itrans.close()\n        otrans.close()\n\n\n    def serve(self):\n        \"\"\"Start a fixed number of worker threads and put client into a queue\"\"\"\n\n        #this is a shared state that can tell the workers to exit when set as false\n        self.isRunning.value = True\n\n        #first bind and listen to the port\n        self.serverTransport.listen()\n\n        #fork the children\n        for i in range(self.numWorkers):\n            try:\n                w = Process(target=self.workerProcess)\n                w.daemon = True\n                w.start()\n                self.workers.append(w)\n            except Exception, x:\n                logging.exception(x)\n\n        #wait until the condition is set by stop()\n\n        while True:\n\n            self.stopCondition.acquire()\n            try:\n                self.stopCondition.wait()\n                break\n            except (SystemExit, KeyboardInterrupt):\n\t\tbreak\n            except Exception, x:\n                logging.exception(x)\n\n        self.isRunning.value = False\n\n    def stop(self):\n        self.isRunning.value = False\n        self.stopCondition.acquire()\n        self.stopCondition.notify()\n        self.stopCondition.release()\n\n"
  },
  {
    "path": "lib/thrift/server/TServer.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\nimport logging\nimport sys\nimport os\nimport traceback\nimport threading\nimport Queue\n\nfrom thrift.Thrift import TProcessor\nfrom thrift.transport import TTransport\nfrom thrift.protocol import TBinaryProtocol\n\nclass TServer:\n\n  \"\"\"Base interface for a server, which must have a serve method.\"\"\"\n\n  \"\"\" 3 constructors for all servers:\n  1) (processor, serverTransport)\n  2) (processor, serverTransport, transportFactory, protocolFactory)\n  3) (processor, serverTransport,\n      inputTransportFactory, outputTransportFactory,\n      inputProtocolFactory, outputProtocolFactory)\"\"\"\n  def __init__(self, *args):\n    if (len(args) == 2):\n      self.__initArgs__(args[0], args[1],\n                        TTransport.TTransportFactoryBase(),\n                        TTransport.TTransportFactoryBase(),\n                        TBinaryProtocol.TBinaryProtocolFactory(),\n                        TBinaryProtocol.TBinaryProtocolFactory())\n    elif (len(args) == 4):\n      self.__initArgs__(args[0], args[1], args[2], args[2], args[3], args[3])\n    elif (len(args) == 6):\n      self.__initArgs__(args[0], args[1], args[2], args[3], args[4], args[5])\n\n  def __initArgs__(self, processor, serverTransport,\n                   inputTransportFactory, outputTransportFactory,\n                   inputProtocolFactory, outputProtocolFactory):\n    self.processor = processor\n    self.serverTransport = serverTransport\n    self.inputTransportFactory = inputTransportFactory\n    self.outputTransportFactory = outputTransportFactory\n    self.inputProtocolFactory = inputProtocolFactory\n    self.outputProtocolFactory = outputProtocolFactory\n\n  def serve(self):\n    pass\n\nclass TSimpleServer(TServer):\n\n  \"\"\"Simple single-threaded server that just pumps around one transport.\"\"\"\n\n  def __init__(self, *args):\n    TServer.__init__(self, *args)\n\n  def serve(self):\n    self.serverTransport.listen()\n    while True:\n      client = self.serverTransport.accept()\n      itrans = self.inputTransportFactory.getTransport(client)\n      otrans = self.outputTransportFactory.getTransport(client)\n      iprot = self.inputProtocolFactory.getProtocol(itrans)\n      oprot = self.outputProtocolFactory.getProtocol(otrans)\n      try:\n        while True:\n          self.processor.process(iprot, oprot)\n      except TTransport.TTransportException, tx:\n        pass\n      except Exception, x:\n        logging.exception(x)\n\n      itrans.close()\n      otrans.close()\n\nclass TThreadedServer(TServer):\n\n  \"\"\"Threaded server that spawns a new thread per each connection.\"\"\"\n\n  def __init__(self, *args, **kwargs):\n    TServer.__init__(self, *args)\n    self.daemon = kwargs.get(\"daemon\", False)\n\n  def serve(self):\n    self.serverTransport.listen()\n    while True:\n      try:\n        client = self.serverTransport.accept()\n        t = threading.Thread(target = self.handle, args=(client,))\n        t.setDaemon(self.daemon)\n        t.start()\n      except KeyboardInterrupt:\n        raise\n      except Exception, x:\n        logging.exception(x)\n\n  def handle(self, client):\n    itrans = self.inputTransportFactory.getTransport(client)\n    otrans = self.outputTransportFactory.getTransport(client)\n    iprot = self.inputProtocolFactory.getProtocol(itrans)\n    oprot = self.outputProtocolFactory.getProtocol(otrans)\n    try:\n      while True:\n        self.processor.process(iprot, oprot)\n    except TTransport.TTransportException, tx:\n      pass\n    except Exception, x:\n      logging.exception(x)\n\n    itrans.close()\n    otrans.close()\n\nclass TThreadPoolServer(TServer):\n\n  \"\"\"Server with a fixed size pool of threads which service requests.\"\"\"\n\n  def __init__(self, *args, **kwargs):\n    TServer.__init__(self, *args)\n    self.clients = Queue.Queue()\n    self.threads = 10\n    self.daemon = kwargs.get(\"daemon\", False)\n\n  def setNumThreads(self, num):\n    \"\"\"Set the number of worker threads that should be created\"\"\"\n    self.threads = num\n\n  def serveThread(self):\n    \"\"\"Loop around getting clients from the shared queue and process them.\"\"\"\n    while True:\n      try:\n        client = self.clients.get()\n        self.serveClient(client)\n      except Exception, x:\n        logging.exception(x)\n\n  def serveClient(self, client):\n    \"\"\"Process input/output from a client for as long as possible\"\"\"\n    itrans = self.inputTransportFactory.getTransport(client)\n    otrans = self.outputTransportFactory.getTransport(client)\n    iprot = self.inputProtocolFactory.getProtocol(itrans)\n    oprot = self.outputProtocolFactory.getProtocol(otrans)\n    try:\n      while True:\n        self.processor.process(iprot, oprot)\n    except TTransport.TTransportException, tx:\n      pass\n    except Exception, x:\n      logging.exception(x)\n\n    itrans.close()\n    otrans.close()\n\n  def serve(self):\n    \"\"\"Start a fixed number of worker threads and put client into a queue\"\"\"\n    for i in range(self.threads):\n      try:\n        t = threading.Thread(target = self.serveThread)\n        t.setDaemon(self.daemon)\n        t.start()\n      except Exception, x:\n        logging.exception(x)\n\n    # Pump the socket for clients\n    self.serverTransport.listen()\n    while True:\n      try:\n        client = self.serverTransport.accept()\n        self.clients.put(client)\n      except Exception, x:\n        logging.exception(x)\n\n\nclass TForkingServer(TServer):\n\n  \"\"\"A Thrift server that forks a new process for each request\"\"\"\n  \"\"\"\n  This is more scalable than the threaded server as it does not cause\n  GIL contention.\n\n  Note that this has different semantics from the threading server.\n  Specifically, updates to shared variables will no longer be shared.\n  It will also not work on windows.\n\n  This code is heavily inspired by SocketServer.ForkingMixIn in the\n  Python stdlib.\n  \"\"\"\n\n  def __init__(self, *args):\n    TServer.__init__(self, *args)\n    self.children = []\n\n  def serve(self):\n    def try_close(file):\n      try:\n        file.close()\n      except IOError, e:\n        logging.warning(e, exc_info=True)\n\n\n    self.serverTransport.listen()\n    while True:\n      client = self.serverTransport.accept()\n      try:\n        pid = os.fork()\n\n        if pid: # parent\n          # add before collect, otherwise you race w/ waitpid\n          self.children.append(pid)\n          self.collect_children()\n\n          # Parent must close socket or the connection may not get\n          # closed promptly\n          itrans = self.inputTransportFactory.getTransport(client)\n          otrans = self.outputTransportFactory.getTransport(client)\n          try_close(itrans)\n          try_close(otrans)\n        else:\n          itrans = self.inputTransportFactory.getTransport(client)\n          otrans = self.outputTransportFactory.getTransport(client)\n\n          iprot = self.inputProtocolFactory.getProtocol(itrans)\n          oprot = self.outputProtocolFactory.getProtocol(otrans)\n\n          ecode = 0\n          try:\n            try:\n              while True:\n                self.processor.process(iprot, oprot)\n            except TTransport.TTransportException, tx:\n              pass\n            except Exception, e:\n              logging.exception(e)\n              ecode = 1\n          finally:\n            try_close(itrans)\n            try_close(otrans)\n\n          os._exit(ecode)\n\n      except TTransport.TTransportException, tx:\n        pass\n      except Exception, x:\n        logging.exception(x)\n\n\n  def collect_children(self):\n    while self.children:\n      try:\n        pid, status = os.waitpid(0, os.WNOHANG)\n      except os.error:\n        pid = None\n\n      if pid:\n        self.children.remove(pid)\n      else:\n        break\n\n\n"
  },
  {
    "path": "lib/thrift/server/__init__.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\n__all__ = ['TServer', 'TNonblockingServer']\n"
  },
  {
    "path": "lib/thrift/transport/THttpClient.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\nfrom TTransport import TTransportBase\nfrom cStringIO import StringIO\n\nimport urlparse\nimport httplib\nimport warnings\nimport socket\n\n\nclass THttpClient(TTransportBase):\n\n    \"\"\"Http implementation of TTransport base.\"\"\"\n\n    def __init__(\n        self,\n        uri_or_host,\n        port=None,\n        path=None,\n        proxy_host=None,\n        proxy_port=None\n    ):\n        \"\"\"THttpClient supports two different types constructor parameters.\n\n        THttpClient(host, port, path) - deprecated\n        THttpClient(uri)\n\n        Only the second supports https.\"\"\"\n\n        \"\"\"THttpClient supports proxy\n        THttpClient(host, port, path, proxy_host, proxy_port) - deprecated\n        ThttpClient(uri, None, None, proxy_host, proxy_port)\"\"\"\n\n        if port is not None:\n            warnings.warn(\n                \"Please use the THttpClient('http://host:port/path') syntax\",\n                DeprecationWarning,\n                stacklevel=2)\n            self.host = uri_or_host\n            self.port = port\n            assert path\n            self.path = path\n            self.scheme = 'http'\n        else:\n            parsed = urlparse.urlparse(uri_or_host)\n            self.scheme = parsed.scheme\n            assert self.scheme in ('http', 'https')\n            if self.scheme == 'http':\n                self.port = parsed.port or httplib.HTTP_PORT\n            elif self.scheme == 'https':\n                self.port = parsed.port or httplib.HTTPS_PORT\n            self.host = parsed.hostname\n            self.path = parsed.path\n            if parsed.query:\n                self.path += '?%s' % parsed.query\n\n        if proxy_host is not None and proxy_port is not None:\n            self.endpoint_host = proxy_host\n            self.endpoint_port = proxy_port\n            self.path = urlparse.urlunparse((\n                self.scheme,\n                \"%s:%i\" % (self.host, self.port),\n                self.path,\n                None,\n                None,\n                None\n            ))\n        else:\n            self.endpoint_host = self.host\n            self.endpoint_port = self.port\n\n        self.__wbuf = StringIO()\n        self.__http = None\n        self.__timeout = None\n        self.__headers = {}\n\n    def open(self):\n        protocol = httplib.HTTP if self.scheme == 'http' else httplib.HTTPS\n        self.__http = protocol(self.endpoint_host, self.endpoint_port)\n\n    def close(self):\n        self.__http.close()\n        self.__http = None\n\n    def isOpen(self):\n        return self.__http is not None\n\n    def setTimeout(self, ms):\n        if not hasattr(socket, 'getdefaulttimeout'):\n            raise NotImplementedError\n\n        if ms is None:\n            self.__timeout = None\n        else:\n            self.__timeout = ms / 1000.0\n\n    def read(self, sz):\n        return self.__http.file.read(sz)\n\n    def write(self, buf):\n        self.__wbuf.write(buf)\n\n    def __withTimeout(f):\n        def _f(*args, **kwargs):\n            orig_timeout = socket.getdefaulttimeout()\n            socket.setdefaulttimeout(args[0].__timeout)\n            result = f(*args, **kwargs)\n            socket.setdefaulttimeout(orig_timeout)\n            return result\n        return _f\n\n    def addHeaders(self, **kwargs):\n        self.__headers.update(kwargs)\n\n    def flush(self):\n        if self.isOpen():\n            self.close()\n        self.open()\n\n        # Pull data out of buffer\n        data = self.__wbuf.getvalue()\n        self.__wbuf = StringIO()\n\n        # HTTP request\n        self.__http.putrequest('POST', self.path)\n\n        # Write headers\n        self.__http.putheader('Host', self.host)\n        self.__http.putheader('Content-Type', 'application/x-thrift')\n        self.__http.putheader('Content-Length', str(len(data)))\n        for key, value in self.__headers.iteritems():\n            self.__http.putheader(key, value)\n        self.__http.endheaders()\n\n        # Write payload\n        self.__http.send(data)\n\n        # Get reply to flush the request\n        self.code, self.message, self.headers = self.__http.getreply()\n\n    # Decorate if we know how to timeout\n    if hasattr(socket, 'getdefaulttimeout'):\n        flush = __withTimeout(flush)\n"
  },
  {
    "path": "lib/thrift/transport/TSSLSocket.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\nimport os\nimport socket\nimport ssl\n\nfrom thrift.transport import TSocket\nfrom thrift.transport.TTransport import TTransportException\n\nclass TSSLSocket(TSocket.TSocket):\n  \"\"\"\n  SSL implementation of client-side TSocket\n\n  This class creates outbound sockets wrapped using the\n  python standard ssl module for encrypted connections.\n  \n  The protocol used is set using the class variable\n  SSL_VERSION, which must be one of ssl.PROTOCOL_* and\n  defaults to  ssl.PROTOCOL_TLSv1 for greatest security.\n  \"\"\"\n  SSL_VERSION = ssl.PROTOCOL_TLSv1\n\n  def __init__(self, host='localhost', port=9090, validate=True, ca_certs=None, unix_socket=None):\n    \"\"\"\n    @param validate: Set to False to disable SSL certificate validation entirely.\n    @type validate: bool\n    @param ca_certs: Filename to the Certificate Authority pem file, possibly a\n    file downloaded from: http://curl.haxx.se/ca/cacert.pem  This is passed to\n    the ssl_wrap function as the 'ca_certs' parameter.\n    @type ca_certs: str\n    \n    Raises an IOError exception if validate is True and the ca_certs file is\n    None, not present or unreadable.\n    \"\"\"\n    self.validate = validate\n    self.is_valid = False\n    self.peercert = None\n    if not validate:\n      self.cert_reqs = ssl.CERT_NONE\n    else:\n      self.cert_reqs = ssl.CERT_REQUIRED\n    self.ca_certs = ca_certs\n    if validate:\n      if ca_certs is None or not os.access(ca_certs, os.R_OK):\n        raise IOError('Certificate Authority ca_certs file \"%s\" is not readable, cannot validate SSL certificates.' % (ca_certs))\n    TSocket.TSocket.__init__(self, host, port, unix_socket)\n\n  def open(self):\n    try:\n      res0 = self._resolveAddr()\n      for res in res0:\n        sock_family, sock_type= res[0:2]\n        ip_port = res[4]\n        plain_sock = socket.socket(sock_family, sock_type)\n        self.handle = ssl.wrap_socket(plain_sock, ssl_version=self.SSL_VERSION,\n            do_handshake_on_connect=True, ca_certs=self.ca_certs, cert_reqs=self.cert_reqs) \n        self.handle.settimeout(self._timeout)\n        try:\n          self.handle.connect(ip_port)\n        except socket.error, e:\n          if res is not res0[-1]:\n            continue\n          else:\n            raise e\n        break\n    except socket.error, e:\n      if self._unix_socket:\n        message = 'Could not connect to secure socket %s' % self._unix_socket\n      else:\n        message = 'Could not connect to %s:%d' % (self.host, self.port)\n      raise TTransportException(type=TTransportException.NOT_OPEN, message=message)\n    if self.validate:\n      self._validate_cert()\n\n  def _validate_cert(self):\n    \"\"\"internal method to validate the peer's SSL certificate, and to check the\n    commonName of the certificate to ensure it matches the hostname we\n    used to make this connection.  Does not support subjectAltName records\n    in certificates.\n    \n    raises TTransportException if the certificate fails validation.\"\"\"\n    cert = self.handle.getpeercert()\n    self.peercert = cert\n    if 'subject' not in cert:\n      raise TTransportException(type=TTransportException.NOT_OPEN,\n                      message='No SSL certificate found from %s:%s' % (self.host, self.port))\n    fields = cert['subject']\n    for field in fields:\n      # ensure structure we get back is what we expect\n      if not isinstance(field, tuple):\n        continue\n      cert_pair = field[0]\n      if len(cert_pair) < 2:\n        continue\n      cert_key, cert_value = cert_pair[0:2]\n      if cert_key != 'commonName':\n        continue\n      certhost = cert_value\n      if certhost == self.host:\n        # success, cert commonName matches desired hostname\n        self.is_valid = True\n        return \n      else:\n        raise TTransportException(type=TTransportException.UNKNOWN,\n                          message='Host name we connected to \"%s\" doesn\\'t match certificate provided commonName \"%s\"' % (self.host, certhost))\n    raise TTransportException(type=TTransportException.UNKNOWN,\n                      message='Could not validate SSL certificate from host \"%s\".  Cert=%s' % (self.host, cert))\n\nclass TSSLServerSocket(TSocket.TServerSocket):\n  \"\"\"\n  SSL implementation of TServerSocket\n\n  This uses the ssl module's wrap_socket() method to provide SSL\n  negotiated encryption.\n  \"\"\"\n  SSL_VERSION = ssl.PROTOCOL_TLSv1\n\n  def __init__(self, host=None, port=9090, certfile='cert.pem', unix_socket=None):\n    \"\"\"Initialize a TSSLServerSocket\n    \n    @param certfile: The filename of the server certificate file, defaults to cert.pem\n    @type certfile: str\n    @param host: The hostname or IP to bind the listen socket to, i.e. 'localhost' for only allowing\n    local network connections. Pass None to bind to all interfaces.\n    @type host: str\n    @param port: The port to listen on for inbound connections.\n    @type port: int\n    \"\"\"\n    self.setCertfile(certfile)\n    TSocket.TServerSocket.__init__(self, host, port)\n\n  def setCertfile(self, certfile):\n    \"\"\"Set or change the server certificate file used to wrap new connections.\n    \n    @param certfile: The filename of the server certificate, i.e. '/etc/certs/server.pem'\n    @type certfile: str\n    \n    Raises an IOError exception if the certfile is not present or unreadable.\n    \"\"\"\n    if not os.access(certfile, os.R_OK):\n      raise IOError('No such certfile found: %s' % (certfile))\n    self.certfile = certfile\n\n  def accept(self):\n    plain_client, addr = self.handle.accept()\n    try:\n      client = ssl.wrap_socket(plain_client, certfile=self.certfile,\n                      server_side=True, ssl_version=self.SSL_VERSION)\n    except ssl.SSLError, ssl_exc:\n      # failed handshake/ssl wrap, close socket to client\n      plain_client.close()\n      # raise ssl_exc\n      # We can't raise the exception, because it kills most TServer derived serve()\n      # methods.\n      # Instead, return None, and let the TServer instance deal with it in\n      # other exception handling.  (but TSimpleServer dies anyway)\n      return None \n    result = TSocket.TSocket()\n    result.setHandle(client)\n    return result\n"
  },
  {
    "path": "lib/thrift/transport/TSocket.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\nfrom TTransport import *\nimport os\nimport errno\nimport socket\nimport sys\n\nclass TSocketBase(TTransportBase):\n  def _resolveAddr(self):\n    if self._unix_socket is not None:\n      return [(socket.AF_UNIX, socket.SOCK_STREAM, None, None, self._unix_socket)]\n    else:\n      return socket.getaddrinfo(self.host, self.port, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE | socket.AI_ADDRCONFIG)\n\n  def close(self):\n    if self.handle:\n      self.handle.close()\n      self.handle = None\n\nclass TSocket(TSocketBase):\n  \"\"\"Socket implementation of TTransport base.\"\"\"\n\n  def __init__(self, host='localhost', port=9090, unix_socket=None):\n    \"\"\"Initialize a TSocket\n\n    @param host(str)  The host to connect to.\n    @param port(int)  The (TCP) port to connect to.\n    @param unix_socket(str)  The filename of a unix socket to connect to.\n                             (host and port will be ignored.)\n    \"\"\"\n\n    self.host = host\n    self.port = port\n    self.handle = None\n    self._unix_socket = unix_socket\n    self._timeout = None\n\n  def setHandle(self, h):\n    self.handle = h\n\n  def isOpen(self):\n    return self.handle is not None\n\n  def setTimeout(self, ms):\n    if ms is None:\n      self._timeout = None\n    else:\n      self._timeout = ms/1000.0\n\n    if self.handle is not None:\n      self.handle.settimeout(self._timeout)\n\n  def open(self):\n    try:\n      res0 = self._resolveAddr()\n      for res in res0:\n        self.handle = socket.socket(res[0], res[1])\n        self.handle.settimeout(self._timeout)\n        try:\n          self.handle.connect(res[4])\n        except socket.error, e:\n          if res is not res0[-1]:\n            continue\n          else:\n            raise e\n        break\n    except socket.error, e:\n      if self._unix_socket:\n        message = 'Could not connect to socket %s' % self._unix_socket\n      else:\n        message = 'Could not connect to %s:%d' % (self.host, self.port)\n      raise TTransportException(type=TTransportException.NOT_OPEN, message=message)\n\n  def read(self, sz):\n    try:\n      buff = self.handle.recv(sz)\n    except socket.error, e:\n      if (e.args[0] == errno.ECONNRESET and\n          (sys.platform == 'darwin' or sys.platform.startswith('freebsd'))):\n        # freebsd and Mach don't follow POSIX semantic of recv\n        # and fail with ECONNRESET if peer performed shutdown.\n        # See corresponding comment and code in TSocket::read()\n        # in lib/cpp/src/transport/TSocket.cpp.\n        self.close()\n        # Trigger the check to raise the END_OF_FILE exception below.\n        buff = ''\n      else:\n        raise\n    if len(buff) == 0:\n      raise TTransportException(type=TTransportException.END_OF_FILE, message='TSocket read 0 bytes')\n    return buff\n\n  def write(self, buff):\n    if not self.handle:\n      raise TTransportException(type=TTransportException.NOT_OPEN, message='Transport not open')\n    sent = 0\n    have = len(buff)\n    while sent < have:\n      plus = self.handle.send(buff)\n      if plus == 0:\n        raise TTransportException(type=TTransportException.END_OF_FILE, message='TSocket sent 0 bytes')\n      sent += plus\n      buff = buff[plus:]\n\n  def flush(self):\n    pass\n\nclass TServerSocket(TSocketBase, TServerTransportBase):\n  \"\"\"Socket implementation of TServerTransport base.\"\"\"\n\n  def __init__(self, host=None, port=9090, unix_socket=None):\n    self.host = host\n    self.port = port\n    self._unix_socket = unix_socket\n    self.handle = None\n\n  def listen(self):\n    res0 = self._resolveAddr()\n    for res in res0:\n      if res[0] is socket.AF_INET6 or res is res0[-1]:\n        break\n\n    # We need remove the old unix socket if the file exists and\n    # nobody is listening on it.\n    if self._unix_socket:\n      tmp = socket.socket(res[0], res[1])\n      try:\n        tmp.connect(res[4])\n      except socket.error, err:\n        eno, message = err.args\n        if eno == errno.ECONNREFUSED:\n          os.unlink(res[4])\n\n    self.handle = socket.socket(res[0], res[1])\n    self.handle.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n    if hasattr(self.handle, 'settimeout'):\n      self.handle.settimeout(None)\n    self.handle.bind(res[4])\n    self.handle.listen(128)\n\n  def accept(self):\n    client, addr = self.handle.accept()\n    result = TSocket()\n    result.setHandle(client)\n    return result\n"
  },
  {
    "path": "lib/thrift/transport/TTransport.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\nfrom cStringIO import StringIO\nfrom struct import pack,unpack\nfrom thrift.Thrift import TException\n\nclass TTransportException(TException):\n\n  \"\"\"Custom Transport Exception class\"\"\"\n\n  UNKNOWN = 0\n  NOT_OPEN = 1\n  ALREADY_OPEN = 2\n  TIMED_OUT = 3\n  END_OF_FILE = 4\n\n  def __init__(self, type=UNKNOWN, message=None):\n    TException.__init__(self, message)\n    self.type = type\n\nclass TTransportBase:\n\n  \"\"\"Base class for Thrift transport layer.\"\"\"\n\n  def isOpen(self):\n    pass\n\n  def open(self):\n    pass\n\n  def close(self):\n    pass\n\n  def read(self, sz):\n    pass\n\n  def readAll(self, sz):\n    buff = ''\n    have = 0\n    while (have < sz):\n      chunk = self.read(sz-have)\n      have += len(chunk)\n      buff += chunk\n\n      if len(chunk) == 0:\n        raise EOFError()\n\n    return buff\n\n  def write(self, buf):\n    pass\n\n  def flush(self):\n    pass\n\n# This class should be thought of as an interface.\nclass CReadableTransport:\n  \"\"\"base class for transports that are readable from C\"\"\"\n\n  # TODO(dreiss): Think about changing this interface to allow us to use\n  #               a (Python, not c) StringIO instead, because it allows\n  #               you to write after reading.\n\n  # NOTE: This is a classic class, so properties will NOT work\n  #       correctly for setting.\n  @property\n  def cstringio_buf(self):\n    \"\"\"A cStringIO buffer that contains the current chunk we are reading.\"\"\"\n    pass\n\n  def cstringio_refill(self, partialread, reqlen):\n    \"\"\"Refills cstringio_buf.\n\n    Returns the currently used buffer (which can but need not be the same as\n    the old cstringio_buf). partialread is what the C code has read from the\n    buffer, and should be inserted into the buffer before any more reads.  The\n    return value must be a new, not borrowed reference.  Something along the\n    lines of self._buf should be fine.\n\n    If reqlen bytes can't be read, throw EOFError.\n    \"\"\"\n    pass\n\nclass TServerTransportBase:\n\n  \"\"\"Base class for Thrift server transports.\"\"\"\n\n  def listen(self):\n    pass\n\n  def accept(self):\n    pass\n\n  def close(self):\n    pass\n\nclass TTransportFactoryBase:\n\n  \"\"\"Base class for a Transport Factory\"\"\"\n\n  def getTransport(self, trans):\n    return trans\n\nclass TBufferedTransportFactory:\n\n  \"\"\"Factory transport that builds buffered transports\"\"\"\n\n  def getTransport(self, trans):\n    buffered = TBufferedTransport(trans)\n    return buffered\n\n\nclass TBufferedTransport(TTransportBase,CReadableTransport):\n\n  \"\"\"Class that wraps another transport and buffers its I/O.\n\n  The implementation uses a (configurable) fixed-size read buffer\n  but buffers all writes until a flush is performed.\n  \"\"\"\n\n  DEFAULT_BUFFER = 4096\n\n  def __init__(self, trans, rbuf_size = DEFAULT_BUFFER):\n    self.__trans = trans\n    self.__wbuf = StringIO()\n    self.__rbuf = StringIO(\"\")\n    self.__rbuf_size = rbuf_size\n\n  def isOpen(self):\n    return self.__trans.isOpen()\n\n  def open(self):\n    return self.__trans.open()\n\n  def close(self):\n    return self.__trans.close()\n\n  def read(self, sz):\n    ret = self.__rbuf.read(sz)\n    if len(ret) != 0:\n      return ret\n\n    self.__rbuf = StringIO(self.__trans.read(max(sz, self.__rbuf_size)))\n    return self.__rbuf.read(sz)\n\n  def write(self, buf):\n    self.__wbuf.write(buf)\n\n  def flush(self):\n    out = self.__wbuf.getvalue()\n    # reset wbuf before write/flush to preserve state on underlying failure\n    self.__wbuf = StringIO()\n    self.__trans.write(out)\n    self.__trans.flush()\n\n  # Implement the CReadableTransport interface.\n  @property\n  def cstringio_buf(self):\n    return self.__rbuf\n\n  def cstringio_refill(self, partialread, reqlen):\n    retstring = partialread\n    if reqlen < self.__rbuf_size:\n      # try to make a read of as much as we can.\n      retstring += self.__trans.read(self.__rbuf_size)\n\n    # but make sure we do read reqlen bytes.\n    if len(retstring) < reqlen:\n      retstring += self.__trans.readAll(reqlen - len(retstring))\n\n    self.__rbuf = StringIO(retstring)\n    return self.__rbuf\n\nclass TMemoryBuffer(TTransportBase, CReadableTransport):\n  \"\"\"Wraps a cStringIO object as a TTransport.\n\n  NOTE: Unlike the C++ version of this class, you cannot write to it\n        then immediately read from it.  If you want to read from a\n        TMemoryBuffer, you must either pass a string to the constructor.\n  TODO(dreiss): Make this work like the C++ version.\n  \"\"\"\n\n  def __init__(self, value=None):\n    \"\"\"value -- a value to read from for stringio\n\n    If value is set, this will be a transport for reading,\n    otherwise, it is for writing\"\"\"\n    if value is not None:\n      self._buffer = StringIO(value)\n    else:\n      self._buffer = StringIO()\n\n  def isOpen(self):\n    return not self._buffer.closed\n\n  def open(self):\n    pass\n\n  def close(self):\n    self._buffer.close()\n\n  def read(self, sz):\n    return self._buffer.read(sz)\n\n  def write(self, buf):\n    self._buffer.write(buf)\n\n  def flush(self):\n    pass\n\n  def getvalue(self):\n    return self._buffer.getvalue()\n\n  # Implement the CReadableTransport interface.\n  @property\n  def cstringio_buf(self):\n    return self._buffer\n\n  def cstringio_refill(self, partialread, reqlen):\n    # only one shot at reading...\n    raise EOFError()\n\nclass TFramedTransportFactory:\n\n  \"\"\"Factory transport that builds framed transports\"\"\"\n\n  def getTransport(self, trans):\n    framed = TFramedTransport(trans)\n    return framed\n\n\nclass TFramedTransport(TTransportBase, CReadableTransport):\n\n  \"\"\"Class that wraps another transport and frames its I/O when writing.\"\"\"\n\n  def __init__(self, trans,):\n    self.__trans = trans\n    self.__rbuf = StringIO()\n    self.__wbuf = StringIO()\n\n  def isOpen(self):\n    return self.__trans.isOpen()\n\n  def open(self):\n    return self.__trans.open()\n\n  def close(self):\n    return self.__trans.close()\n\n  def read(self, sz):\n    ret = self.__rbuf.read(sz)\n    if len(ret) != 0:\n      return ret\n\n    self.readFrame()\n    return self.__rbuf.read(sz)\n\n  def readFrame(self):\n    buff = self.__trans.readAll(4)\n    sz, = unpack('!i', buff)\n    self.__rbuf = StringIO(self.__trans.readAll(sz))\n\n  def write(self, buf):\n    self.__wbuf.write(buf)\n\n  def flush(self):\n    wout = self.__wbuf.getvalue()\n    wsz = len(wout)\n    # reset wbuf before write/flush to preserve state on underlying failure\n    self.__wbuf = StringIO()\n    # N.B.: Doing this string concatenation is WAY cheaper than making\n    # two separate calls to the underlying socket object. Socket writes in\n    # Python turn out to be REALLY expensive, but it seems to do a pretty\n    # good job of managing string buffer operations without excessive copies\n    buf = pack(\"!i\", wsz) + wout\n    self.__trans.write(buf)\n    self.__trans.flush()\n\n  # Implement the CReadableTransport interface.\n  @property\n  def cstringio_buf(self):\n    return self.__rbuf\n\n  def cstringio_refill(self, prefix, reqlen):\n    # self.__rbuf will already be empty here because fastbinary doesn't\n    # ask for a refill until the previous buffer is empty.  Therefore,\n    # we can start reading new frames immediately.\n    while len(prefix) < reqlen:\n      self.readFrame()\n      prefix += self.__rbuf.getvalue()\n    self.__rbuf = StringIO(prefix)\n    return self.__rbuf\n\n\nclass TFileObjectTransport(TTransportBase):\n  \"\"\"Wraps a file-like object to make it work as a Thrift transport.\"\"\"\n\n  def __init__(self, fileobj):\n    self.fileobj = fileobj\n\n  def isOpen(self):\n    return True\n\n  def close(self):\n    self.fileobj.close()\n\n  def read(self, sz):\n    return self.fileobj.read(sz)\n\n  def write(self, buf):\n    self.fileobj.write(buf)\n\n  def flush(self):\n    self.fileobj.flush()\n"
  },
  {
    "path": "lib/thrift/transport/TTwisted.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\nfrom zope.interface import implements, Interface, Attribute\nfrom twisted.internet.protocol import Protocol, ServerFactory, ClientFactory, \\\n    connectionDone\nfrom twisted.internet import defer\nfrom twisted.protocols import basic\nfrom twisted.python import log\nfrom twisted.web import server, resource, http\n\nfrom thrift.transport import TTransport\nfrom cStringIO import StringIO\n\n\nclass TMessageSenderTransport(TTransport.TTransportBase):\n\n    def __init__(self):\n        self.__wbuf = StringIO()\n\n    def write(self, buf):\n        self.__wbuf.write(buf)\n\n    def flush(self):\n        msg = self.__wbuf.getvalue()\n        self.__wbuf = StringIO()\n        self.sendMessage(msg)\n\n    def sendMessage(self, message):\n        raise NotImplementedError\n\n\nclass TCallbackTransport(TMessageSenderTransport):\n\n    def __init__(self, func):\n        TMessageSenderTransport.__init__(self)\n        self.func = func\n\n    def sendMessage(self, message):\n        self.func(message)\n\n\nclass ThriftClientProtocol(basic.Int32StringReceiver):\n\n    MAX_LENGTH = 2 ** 31 - 1\n\n    def __init__(self, client_class, iprot_factory, oprot_factory=None):\n        self._client_class = client_class\n        self._iprot_factory = iprot_factory\n        if oprot_factory is None:\n            self._oprot_factory = iprot_factory\n        else:\n            self._oprot_factory = oprot_factory\n\n        self.recv_map = {}\n        self.started = defer.Deferred()\n\n    def dispatch(self, msg):\n        self.sendString(msg)\n\n    def connectionMade(self):\n        tmo = TCallbackTransport(self.dispatch)\n        self.client = self._client_class(tmo, self._oprot_factory)\n        self.started.callback(self.client)\n\n    def connectionLost(self, reason=connectionDone):\n        for k,v in self.client._reqs.iteritems():\n            tex = TTransport.TTransportException(\n                type=TTransport.TTransportException.END_OF_FILE,\n                message='Connection closed')\n            v.errback(tex)\n\n    def stringReceived(self, frame):\n        tr = TTransport.TMemoryBuffer(frame)\n        iprot = self._iprot_factory.getProtocol(tr)\n        (fname, mtype, rseqid) = iprot.readMessageBegin()\n\n        try:\n            method = self.recv_map[fname]\n        except KeyError:\n            method = getattr(self.client, 'recv_' + fname)\n            self.recv_map[fname] = method\n\n        method(iprot, mtype, rseqid)\n\n\nclass ThriftServerProtocol(basic.Int32StringReceiver):\n\n    MAX_LENGTH = 2 ** 31 - 1\n\n    def dispatch(self, msg):\n        self.sendString(msg)\n\n    def processError(self, error):\n        self.transport.loseConnection()\n\n    def processOk(self, _, tmo):\n        msg = tmo.getvalue()\n\n        if len(msg) > 0:\n            self.dispatch(msg)\n\n    def stringReceived(self, frame):\n        tmi = TTransport.TMemoryBuffer(frame)\n        tmo = TTransport.TMemoryBuffer()\n\n        iprot = self.factory.iprot_factory.getProtocol(tmi)\n        oprot = self.factory.oprot_factory.getProtocol(tmo)\n\n        d = self.factory.processor.process(iprot, oprot)\n        d.addCallbacks(self.processOk, self.processError,\n            callbackArgs=(tmo,))\n\n\nclass IThriftServerFactory(Interface):\n\n    processor = Attribute(\"Thrift processor\")\n\n    iprot_factory = Attribute(\"Input protocol factory\")\n\n    oprot_factory = Attribute(\"Output protocol factory\")\n\n\nclass IThriftClientFactory(Interface):\n\n    client_class = Attribute(\"Thrift client class\")\n\n    iprot_factory = Attribute(\"Input protocol factory\")\n\n    oprot_factory = Attribute(\"Output protocol factory\")\n\n\nclass ThriftServerFactory(ServerFactory):\n\n    implements(IThriftServerFactory)\n\n    protocol = ThriftServerProtocol\n\n    def __init__(self, processor, iprot_factory, oprot_factory=None):\n        self.processor = processor\n        self.iprot_factory = iprot_factory\n        if oprot_factory is None:\n            self.oprot_factory = iprot_factory\n        else:\n            self.oprot_factory = oprot_factory\n\n\nclass ThriftClientFactory(ClientFactory):\n\n    implements(IThriftClientFactory)\n\n    protocol = ThriftClientProtocol\n\n    def __init__(self, client_class, iprot_factory, oprot_factory=None):\n        self.client_class = client_class\n        self.iprot_factory = iprot_factory\n        if oprot_factory is None:\n            self.oprot_factory = iprot_factory\n        else:\n            self.oprot_factory = oprot_factory\n\n    def buildProtocol(self, addr):\n        p = self.protocol(self.client_class, self.iprot_factory,\n            self.oprot_factory)\n        p.factory = self\n        return p\n\n\nclass ThriftResource(resource.Resource):\n\n    allowedMethods = ('POST',)\n\n    def __init__(self, processor, inputProtocolFactory,\n        outputProtocolFactory=None):\n        resource.Resource.__init__(self)\n        self.inputProtocolFactory = inputProtocolFactory\n        if outputProtocolFactory is None:\n            self.outputProtocolFactory = inputProtocolFactory\n        else:\n            self.outputProtocolFactory = outputProtocolFactory\n        self.processor = processor\n\n    def getChild(self, path, request):\n        return self\n\n    def _cbProcess(self, _, request, tmo):\n        msg = tmo.getvalue()\n        request.setResponseCode(http.OK)\n        request.setHeader(\"content-type\", \"application/x-thrift\")\n        request.write(msg)\n        request.finish()\n\n    def render_POST(self, request):\n        request.content.seek(0, 0)\n        data = request.content.read()\n        tmi = TTransport.TMemoryBuffer(data)\n        tmo = TTransport.TMemoryBuffer()\n\n        iprot = self.inputProtocolFactory.getProtocol(tmi)\n        oprot = self.outputProtocolFactory.getProtocol(tmo)\n\n        d = self.processor.process(iprot, oprot)\n        d.addCallback(self._cbProcess, request, tmo)\n        return server.NOT_DONE_YET\n"
  },
  {
    "path": "lib/thrift/transport/TZlibTransport.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n'''\nTZlibTransport provides a compressed transport and transport factory\nclass, using the python standard library zlib module to implement\ndata compression.\n'''\n\nfrom __future__ import division\nimport zlib\nfrom cStringIO import StringIO\nfrom TTransport import TTransportBase, CReadableTransport\n\nclass TZlibTransportFactory(object):\n  '''\n  Factory transport that builds zlib compressed transports.\n  \n  This factory caches the last single client/transport that it was passed\n  and returns the same TZlibTransport object that was created.\n  \n  This caching means the TServer class will get the _same_ transport\n  object for both input and output transports from this factory.\n  (For non-threaded scenarios only, since the cache only holds one object)\n  \n  The purpose of this caching is to allocate only one TZlibTransport where\n  only one is really needed (since it must have separate read/write buffers),\n  and makes the statistics from getCompSavings() and getCompRatio()\n  easier to understand.\n  '''\n\n  # class scoped cache of last transport given and zlibtransport returned\n  _last_trans = None\n  _last_z = None\n\n  def getTransport(self, trans, compresslevel=9):\n    '''Wrap a transport , trans, with the TZlibTransport\n    compressed transport class, returning a new\n    transport to the caller.\n    \n    @param compresslevel: The zlib compression level, ranging\n    from 0 (no compression) to 9 (best compression).  Defaults to 9.\n    @type compresslevel: int\n    \n    This method returns a TZlibTransport which wraps the\n    passed C{trans} TTransport derived instance.\n    '''\n    if trans == self._last_trans:\n      return self._last_z\n    ztrans = TZlibTransport(trans, compresslevel)\n    self._last_trans = trans\n    self._last_z = ztrans\n    return ztrans\n\n\nclass TZlibTransport(TTransportBase, CReadableTransport):\n  '''\n  Class that wraps a transport with zlib, compressing writes\n  and decompresses reads, using the python standard\n  library zlib module.\n  '''\n\n  # Read buffer size for the python fastbinary C extension,\n  # the TBinaryProtocolAccelerated class.\n  DEFAULT_BUFFSIZE = 4096\n\n  def __init__(self, trans, compresslevel=9):\n    '''\n    Create a new TZlibTransport, wrapping C{trans}, another\n    TTransport derived object.\n    \n    @param trans: A thrift transport object, i.e. a TSocket() object.\n    @type trans: TTransport\n    @param compresslevel: The zlib compression level, ranging\n    from 0 (no compression) to 9 (best compression).  Default is 9.\n    @type compresslevel: int\n    '''\n    self.__trans = trans\n    self.compresslevel = compresslevel\n    self.__rbuf = StringIO()\n    self.__wbuf = StringIO()\n    self._init_zlib()\n    self._init_stats()\n\n  def _reinit_buffers(self):\n    '''\n    Internal method to initialize/reset the internal StringIO objects\n    for read and write buffers.\n    '''\n    self.__rbuf = StringIO()\n    self.__wbuf = StringIO()\n\n  def _init_stats(self):\n    '''\n    Internal method to reset the internal statistics counters\n    for compression ratios and bandwidth savings.\n    '''\n    self.bytes_in = 0\n    self.bytes_out = 0\n    self.bytes_in_comp = 0\n    self.bytes_out_comp = 0\n\n  def _init_zlib(self):\n    '''\n    Internal method for setting up the zlib compression and\n    decompression objects.\n    '''\n    self._zcomp_read = zlib.decompressobj()\n    self._zcomp_write = zlib.compressobj(self.compresslevel)\n\n  def getCompRatio(self):\n    '''\n    Get the current measured compression ratios (in,out) from\n    this transport.\n    \n    Returns a tuple of: \n    (inbound_compression_ratio, outbound_compression_ratio)\n    \n    The compression ratios are computed as:\n        compressed / uncompressed\n\n    E.g., data that compresses by 10x will have a ratio of: 0.10\n    and data that compresses to half of ts original size will\n    have a ratio of 0.5\n    \n    None is returned if no bytes have yet been processed in\n    a particular direction.\n    '''\n    r_percent, w_percent = (None, None)\n    if self.bytes_in > 0:\n      r_percent = self.bytes_in_comp / self.bytes_in\n    if self.bytes_out > 0:\n      w_percent = self.bytes_out_comp / self.bytes_out\n    return (r_percent, w_percent)\n\n  def getCompSavings(self):\n    '''\n    Get the current count of saved bytes due to data\n    compression.\n    \n    Returns a tuple of:\n    (inbound_saved_bytes, outbound_saved_bytes)\n    \n    Note: if compression is actually expanding your\n    data (only likely with very tiny thrift objects), then\n    the values returned will be negative.\n    '''\n    r_saved = self.bytes_in - self.bytes_in_comp\n    w_saved = self.bytes_out - self.bytes_out_comp\n    return (r_saved, w_saved)\n\n  def isOpen(self):\n    '''Return the underlying transport's open status'''\n    return self.__trans.isOpen()\n\n  def open(self):\n    \"\"\"Open the underlying transport\"\"\"\n    self._init_stats()\n    return self.__trans.open()\n\n  def listen(self):\n    '''Invoke the underlying transport's listen() method'''\n    self.__trans.listen()\n\n  def accept(self):\n    '''Accept connections on the underlying transport'''\n    return self.__trans.accept()\n\n  def close(self):\n    '''Close the underlying transport,'''\n    self._reinit_buffers()\n    self._init_zlib()\n    return self.__trans.close()\n\n  def read(self, sz):\n    '''\n    Read up to sz bytes from the decompressed bytes buffer, and\n    read from the underlying transport if the decompression\n    buffer is empty.\n    '''\n    ret = self.__rbuf.read(sz)\n    if len(ret) > 0:\n      return ret\n    # keep reading from transport until something comes back\n    while True:\n      if self.readComp(sz):\n        break\n    ret = self.__rbuf.read(sz)\n    return ret\n\n  def readComp(self, sz):\n    '''\n    Read compressed data from the underlying transport, then\n    decompress it and append it to the internal StringIO read buffer\n    '''\n    zbuf = self.__trans.read(sz)\n    zbuf = self._zcomp_read.unconsumed_tail + zbuf\n    buf = self._zcomp_read.decompress(zbuf)\n    self.bytes_in += len(zbuf)\n    self.bytes_in_comp += len(buf)\n    old = self.__rbuf.read()\n    self.__rbuf = StringIO(old + buf)\n    if len(old) + len(buf) == 0:\n      return False\n    return True\n\n  def write(self, buf):\n    '''\n    Write some bytes, putting them into the internal write\n    buffer for eventual compression.\n    '''\n    self.__wbuf.write(buf)\n\n  def flush(self):\n    '''\n    Flush any queued up data in the write buffer and ensure the\n    compression buffer is flushed out to the underlying transport\n    '''\n    wout = self.__wbuf.getvalue()\n    if len(wout) > 0:\n      zbuf = self._zcomp_write.compress(wout)\n      self.bytes_out += len(wout)\n      self.bytes_out_comp += len(zbuf)\n    else:\n      zbuf = ''\n    ztail = self._zcomp_write.flush(zlib.Z_SYNC_FLUSH)\n    self.bytes_out_comp += len(ztail)\n    if (len(zbuf) + len(ztail)) > 0:\n      self.__wbuf = StringIO()\n      self.__trans.write(zbuf + ztail)\n    self.__trans.flush()\n\n  @property\n  def cstringio_buf(self):\n    '''Implement the CReadableTransport interface'''\n    return self.__rbuf\n\n  def cstringio_refill(self, partialread, reqlen):\n    '''Implement the CReadableTransport interface for refill'''\n    retstring = partialread\n    if reqlen < self.DEFAULT_BUFFSIZE:\n      retstring += self.read(self.DEFAULT_BUFFSIZE)\n    while len(retstring) < reqlen:\n      retstring += self.read(reqlen - len(retstring))\n    self.__rbuf = StringIO(retstring)\n    return self.__rbuf\n"
  },
  {
    "path": "lib/thrift/transport/__init__.py",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n\n__all__ = ['TTransport', 'TSocket', 'THttpClient','TZlibTransport']\n"
  },
  {
    "path": "sublime_evernote.py",
    "content": "#coding:utf-8\nimport sys\nsys.path.insert(0,\"lib\")\nimport evernote.edam.userstore.UserStore as UserStore\nimport evernote.edam.notestore.NoteStore as NoteStore\nimport evernote.edam.type.ttypes as Types\nimport evernote.edam.error.ttypes as Errors\nfrom evernote.api.client import EvernoteClient\nimport sublime,sublime_plugin\nimport markdown2\nimport webbrowser\n\nconsumer_key = 'oparrish-4096'\nconsumer_secret ='c112c6417738f06a'\nevernoteHost = \"www.evernote.com\"\ncallbackUrl = \"http://127.0.0.1/sublimeevernote/callback\"\nsettings = sublime.load_settings(\"SublimeEvernote.sublime-settings\")\n\n\ndef get_evernote_client(token=None):\n    if token:\n        return EvernoteClient(token=token,service_host=evernoteHost, sandbox=False)\n    else:\n        return EvernoteClient(\n            consumer_key=consumer_key,\n            consumer_secret=consumer_secret,\n            service_host=evernoteHost, \n            sandbox=False\n        )    \n\nclass SendToEvernoteCommand(sublime_plugin.TextCommand):\n    def __init__(self,view):\n        self.view = view    \n        self.window = sublime.active_window()\n\n    def to_markdown_html(self):\n        encoding = self.view.encoding()\n        if encoding == 'Undefined':\n            encoding = 'utf-8'\n        elif encoding == 'Western (Windows 1252)':\n            encoding = 'windows-1252'\n\n\n        sels = self.view.sel()\n        contents = ''\n        if sels:\n            for sel in sels: contents += self.view.substr(sel) + '\\n\\n'   \n\n        if not contents.strip():\n            region = sublime.Region(0L, self.view.size())\n            contents = self.view.substr(region) \n\n        markdown_html = markdown2.markdown(contents, extras=['footnotes', 'fenced-code-blocks', 'cuddled-lists', 'code-friendly', 'metadata'])\n        return markdown_html\n\n    def connect(self,callback,**kwargs):\n        sublime.status_message(\"authenticate..., please wait...\")   \n        client = get_evernote_client()    \n        request_token = client.get_request_token(callbackUrl)\n\n        def on_verifier(verifier):\n            access_token =  client.get_access_token(request_token['oauth_token'],request_token['oauth_token_secret'],verifier)\n            settings.set('access_token',access_token)\n            sublime.save_settings('SublimeEvernote.sublime-settings') \n            sublime.status_message(\"authenticate ok\")\n            callback(**kwargs)\n\n        webbrowser.open(client.get_authorize_url(request_token))\n        self.window.show_input_panel(\"type Verifier (required):\",'',on_verifier,None,None) \n\n    def send_note(self,**kwargs):\n        access_token = settings.get('access_token')\n        client,noteStore = None,None\n        if access_token :\n            client = get_evernote_client(token=access_token)    \n        else:\n            return self.connect(self.send_note,**kwargs)\n            \n        try:\n            noteStore = client.get_note_store()     \n        except Exception as e:\n            if sublime.ok_cancel_dialog('error %s! retry?'%e):\n                self.connect(self.send_note,**kwargs)\n\n        markdown_html = self.to_markdown_html()\n\n        def sendnote(title,tags):\n            note = Types.Note()\n            note.title = title.encode('utf-8')\n            note.content = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n            note.content += '<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">'\n            note.content += '<en-note>%s'%markdown_html.encode('utf-8')\n            note.content += '</en-note>'\n            note.tagNames = tags and tags.split(\",\") or []\n            try:\n                sublime.status_message(\"please wait...\")   \n                cnote = noteStore.createNote(access_token, note)   \n                sublime.status_message(\"send success guid:%s\"%cnote.guid)  \n                sublime.message_dialog(\"success\") \n            except Errors.EDAMUserException as e:\n                args = dict(title=title,tags=tags)\n                if e.errorCode == 9:\n                    self.connect(self.send_note,**args)\n                else:\n                    if sublime.ok_cancel_dialog('error %s! retry?'%e):\n                        self.connect(self.send_note,**args)\n            except  Exception as e:\n                sublime.error_message('error %s'%e)\n\n        def on_title(title):\n            def on_tags(tags):\n                sendnote(title,tags)\n            if not 'tags' in markdown_html.metadata:\n                self.window.show_input_panel(\"Tags (Optional)::\",\"\",on_tags,None,None) \n            else:\n                sendnote(title, markdown_html.metadata['tags'])\n\n        if not(kwargs.get(\"title\") or 'title' in markdown_html.metadata):\n            self.window.show_input_panel(\"Title (required)::\",\"\",on_title,None,None)\n        elif not kwargs.get(\"tags\"):\n            on_title(markdown_html.metadata['title'])\n        else:    \n            sendnote(kwargs.get(\"title\"),kwargs.get(\"tags\")) \n\n    def run(self, edit):\n        if not settings.get(\"access_token\"):\n            self.connect(self.send_note)\n        else:\n            self.send_note()\n"
  }
]