From f4dac1e16207da7f709cc0bdd30438596c10da6b Mon Sep 17 00:00:00 2001 From: jiangpengfei Date: Fri, 24 Nov 2023 18:44:52 +0800 Subject: [PATCH] test: update test thrift file --- tests/evernote-thrift/LICENSE | 27 + tests/evernote-thrift/README.md | 5 + tests/evernote-thrift/src/Errors.thrift | 282 ++ tests/evernote-thrift/src/Limits.thrift | 1120 ++++++ tests/evernote-thrift/src/NoteStore.thrift | 4181 ++++++++++++++++++++ tests/evernote-thrift/src/Types.thrift | 3112 +++++++++++++++ tests/evernote-thrift/src/UserStore.thrift | 830 ++++ 7 files changed, 9557 insertions(+) create mode 100644 tests/evernote-thrift/LICENSE create mode 100644 tests/evernote-thrift/README.md create mode 100644 tests/evernote-thrift/src/Errors.thrift create mode 100644 tests/evernote-thrift/src/Limits.thrift create mode 100644 tests/evernote-thrift/src/NoteStore.thrift create mode 100644 tests/evernote-thrift/src/Types.thrift create mode 100644 tests/evernote-thrift/src/UserStore.thrift diff --git a/tests/evernote-thrift/LICENSE b/tests/evernote-thrift/LICENSE new file mode 100644 index 0000000..f474071 --- /dev/null +++ b/tests/evernote-thrift/LICENSE @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2007-2016 by Evernote Corporation, All rights reserved. + * + * Use of the source code and binary libraries included in this package + * is permitted under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ diff --git a/tests/evernote-thrift/README.md b/tests/evernote-thrift/README.md new file mode 100644 index 0000000..4635154 --- /dev/null +++ b/tests/evernote-thrift/README.md @@ -0,0 +1,5 @@ +# Evernote Cloud API Thrift IDL files version 1.29 + +This repository contains the Thrift interface definition files for the Evernote Cloud API. Most developers won't need these, but they can be helpful if you're generating your own Thrift code for some reason. + +See https://dev.evernote.com/doc/ for full Cloud API documentation. diff --git a/tests/evernote-thrift/src/Errors.thrift b/tests/evernote-thrift/src/Errors.thrift new file mode 100644 index 0000000..4a0f650 --- /dev/null +++ b/tests/evernote-thrift/src/Errors.thrift @@ -0,0 +1,282 @@ +/* + * Copyright 2007-2018 Evernote Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file contains the definitions of the Evernote-related errors that + * can occur when making calls to EDAM services. + */ + +include "Types.thrift" + +namespace as3 com.evernote.edam.error +namespace java com.evernote.edam.error +namespace csharp Evernote.EDAM.Error +namespace py evernote.edam.error +namespace cpp evernote.edam +namespace rb Evernote.EDAM.Error +namespace php EDAM.Error +namespace perl EDAMErrors +namespace go edam + +/** + * Numeric codes indicating the type of error that occurred on the + * service. + *
+ *
UNKNOWN
+ *
No information available about the error
+ *
BAD_DATA_FORMAT
+ *
The format of the request data was incorrect
+ *
PERMISSION_DENIED
+ *
Not permitted to perform action
+ *
INTERNAL_ERROR
+ *
Unexpected problem with the service
+ *
DATA_REQUIRED
+ *
A required parameter/field was absent
+ *
LIMIT_REACHED
+ *
Operation denied due to data model limit
+ *
QUOTA_REACHED
+ *
Operation denied due to user storage limit
+ *
INVALID_AUTH
+ *
Username and/or password incorrect
+ *
AUTH_EXPIRED
+ *
Authentication token expired
+ *
DATA_CONFLICT
+ *
Change denied due to data model conflict
+ *
ENML_VALIDATION
+ *
Content of submitted note was malformed
+ *
SHARD_UNAVAILABLE
+ *
Service shard with account data is temporarily down
+ *
LEN_TOO_SHORT
+ *
Operation denied due to data model limit, where something such + * as a string length was too short
+ *
LEN_TOO_LONG
+ *
Operation denied due to data model limit, where something such + * as a string length was too long
+ *
TOO_FEW
+ *
Operation denied due to data model limit, where there were + * too few of something.
+ *
TOO_MANY
+ *
Operation denied due to data model limit, where there were + * too many of something.
+ *
UNSUPPORTED_OPERATION
+ *
Operation denied because it is currently unsupported.
+ *
TAKEN_DOWN
+ *
Operation denied because access to the corresponding object is + * prohibited in response to a take-down notice.
+ *
RATE_LIMIT_REACHED
+ *
Operation denied because the calling application has reached + * its hourly API call limit for this user.
+ *
BUSINESS_SECURITY_LOGIN_REQUIRED
+ *
Access to a business account has been denied because the user must complete + * additional steps in order to comply with business security requirements.
+ *
DEVICE_LIMIT_REACHED
+ *
Operation denied because the user has exceeded their maximum allowed + * number of devices.
+ *
OPENID_ALREADY_TAKEN
+ *
Operation failed because the Open ID is already associated with another user.
+ *
INVALID_OPENID_TOKEN
+ *
Operation denied because the Open ID token is invalid. Please re-issue a valid + * token.
+ *
USER_NOT_REGISTERED
+ *
There is no Evernote user associated with this OpenID account, + * and no Evernote user with a matching email
+ *
USER_NOT_ASSOCIATED
+ *
There is no Evernote user associated with this OpenID account, + * but Evernote user with matching email exists
+ *
USER_ALREADY_ASSOCIATED
+ *
Evernote user is already associated with this provider + * using a different email address.
+ *
ACCOUNT_CLEAR
+ *
The user's account has been disabled. Clients should deal with this errorCode + * by logging the user out and purging all locally saved content, including local + * edits not yet pushed to the server.
+ *
SSO_AUTHENTICATION_REQUIRED
+ *
SSO authentication is the only tyoe of authentication allowed for the user's + * account. This error is thrown when the user attempts to authenticate by another + * method (password, OpenId, etc).
+ *
+ */ +enum EDAMErrorCode { + UNKNOWN = 1, + BAD_DATA_FORMAT = 2, + PERMISSION_DENIED = 3, + INTERNAL_ERROR = 4, + DATA_REQUIRED = 5, + LIMIT_REACHED = 6, + QUOTA_REACHED = 7, + INVALID_AUTH = 8, + AUTH_EXPIRED = 9, + DATA_CONFLICT = 10, + ENML_VALIDATION = 11, + SHARD_UNAVAILABLE = 12, + LEN_TOO_SHORT = 13, + LEN_TOO_LONG = 14, + TOO_FEW = 15, + TOO_MANY = 16, + UNSUPPORTED_OPERATION = 17, + TAKEN_DOWN = 18, + RATE_LIMIT_REACHED = 19, + BUSINESS_SECURITY_LOGIN_REQUIRED = 20, + DEVICE_LIMIT_REACHED = 21, + OPENID_ALREADY_TAKEN = 22, + INVALID_OPENID_TOKEN = 23, + USER_NOT_ASSOCIATED = 24, + USER_NOT_REGISTERED = 25, + USER_ALREADY_ASSOCIATED = 26, + ACCOUNT_CLEAR = 27, + SSO_AUTHENTICATION_REQUIRED = 28 +} + + +/** + * An enumeration that provides a reason for why a given contact was invalid, for example, + * as thrown via an EDAMInvalidContactsException. + * + *
+ *
BAD_ADDRESS
+ *
The contact information does not represent a valid address for a recipient. + * Clients should be validating and normalizing contacts, so receiving this + * error code commonly represents a client error. + *
+ *
DUPLICATE_CONTACT
+ *
If the method throwing this exception accepts a list of contacts, this error + * code indicates that the given contact is a duplicate of another contact in + * the list. Note that the server may clean up contacts, and that this cleanup + * occurs before checking for duplication. Receiving this error is commonly + * an indication of a client issue, since client should be normalizing contacts + * and removing duplicates. All instances that are duplicates are returned. For + * example, if a list of 5 contacts has the same e-mail address twice, the two + * conflicting e-mail address contacts will be returned. + *
+ *
NO_CONNECTION
+ *
Indicates that the given contact, an Evernote type contact, is not connected + * to the user for which the call is being made. It is possible that clients are + * out of sync with the server and should re-synchronize their identities and + * business user state. See Identity.userConnected for more information on user + * connections. + *
+ *
+ * + * Note that if multiple reasons may apply, only one is returned. The precedence order + * is BAD_ADDRESS, DUPLICATE_CONTACT, NO_CONNECTION, meaning that if a contact has a bad + * address and is also duplicated, it will be returned as a BAD_ADDRESS. + */ +enum EDAMInvalidContactReason { + BAD_ADDRESS, + DUPLICATE_CONTACT, + NO_CONNECTION +} + + +/** + * This exception is thrown by EDAM procedures when a call fails as a result of + * a problem that a caller may be able to resolve. For example, if the user + * attempts to add a note to their account which would exceed their storage + * quota, this type of exception may be thrown to indicate the source of the + * error so that they can choose an alternate action. + * + * This exception would not be used for internal system errors that do not + * reflect user actions, but rather reflect a problem within the service that + * the user cannot resolve. + * + * errorCode: The numeric code indicating the type of error that occurred. + * must be one of the values of EDAMErrorCode. + * + * parameter: If the error applied to a particular input parameter, this will + * indicate which parameter. For some errors (USER_NOT_ASSOCIATED, USER_NOT_REGISTERED, + * SSO_AUTHENTICATION_REQUIRED), this is the user's email. + */ +exception EDAMUserException { + 1: required EDAMErrorCode errorCode, + 2: optional string parameter +} + + +/** + * This exception is thrown by EDAM procedures when a call fails as a result of + * a problem in the service that could not be changed through caller action. + * + * errorCode: The numeric code indicating the type of error that occurred. + * must be one of the values of EDAMErrorCode. + * + * message: This may contain additional information about the error + * + * rateLimitDuration: Indicates the minimum number of seconds that an application should + * expect subsequent API calls for this user to fail. The application should not retry + * API requests for the user until at least this many seconds have passed. Present only + * when errorCode is RATE_LIMIT_REACHED, + */ +exception EDAMSystemException { + 1: required EDAMErrorCode errorCode, + 2: optional string message, + 3: optional i32 rateLimitDuration +} + + +/** + * This exception is thrown by EDAM procedures when a caller asks to perform + * an operation on an object that does not exist. This may be thrown based on an invalid + * primary identifier (e.g. a bad GUID), or when the caller refers to an object + * by another unique identifier (e.g. a User's email address). + * + * identifier: A description of the object that was not found on the server. + * For example, "Note.notebookGuid" when a caller attempts to create a note in a + * notebook that does not exist in the user's account. + * + * key: The value passed from the client in the identifier, which was not + * found. For example, the GUID that was not found. + */ +exception EDAMNotFoundException { + 1: optional string identifier, + 2: optional string key +} + +/** + * An exception thrown when the provided Contacts fail validation. For instance, + * email domains could be invalid, phone numbers might not be valid for SMS, + * etc. + * + * We will not provide individual reasons for each Contact's validation failure. + * The presence of the Contact in this exception means that the user must figure + * out how to take appropriate action to fix this Contact. + * + *
+ *
contacts
+ *
The list of Contacts that are considered invalid by the service
+ * + *
parameter
+ *
If the error applied to a particular input parameter, this will + * indicate which parameter.
+ * + *
reasons
+ *
If supplied, the list of reasons why the server considered a contact invalid, + * matching, in order, the list returned in the contacts field.
+ *
+ */ +exception EDAMInvalidContactsException { + 1: required list contacts, + 2: optional string parameter, + 3: optional list reasons +} diff --git a/tests/evernote-thrift/src/Limits.thrift b/tests/evernote-thrift/src/Limits.thrift new file mode 100644 index 0000000..fa9080c --- /dev/null +++ b/tests/evernote-thrift/src/Limits.thrift @@ -0,0 +1,1120 @@ +/* + * Copyright 2007-2018 Evernote Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file contains the allowable limits for the various fields and + * collections that make up the EDAM data model. + */ + +namespace as3 com.evernote.edam.limits +namespace java com.evernote.edam.limits +namespace csharp Evernote.EDAM.Limits +namespace py evernote.edam.limits +namespace cpp evernote.limits +namespace rb Evernote.EDAM.Limits +namespace php EDAM.Limits +namespace cocoa EDAM +namespace perl EDAMLimits +namespace go edam + + +// ========================== string field limits ============================== + +/** + * Minimum length of any string-based attribute, in Unicode chars + */ +const i32 EDAM_ATTRIBUTE_LEN_MIN = 1; +/** + * Maximum length of any string-based attribute, in Unicode chars + */ +const i32 EDAM_ATTRIBUTE_LEN_MAX = 4096; +/** + * Any string-based attribute must match the provided regular expression. + * This excludes all Unicode line endings and control characters. + */ +const string EDAM_ATTRIBUTE_REGEX = "^[^\\p{Cc}\\p{Zl}\\p{Zp}]{1,4096}$"; + +/** + * The maximum number of values that can be stored in a list-based attribute + * (e.g. see UserAttributes.recentMailedAddresses) + */ +const i32 EDAM_ATTRIBUTE_LIST_MAX = 100; + +/** + * The maximum number of entries that can be stored in a map-based attribute + * such as applicationData fields in Resources and Notes. + */ +const i32 EDAM_ATTRIBUTE_MAP_MAX = 100; + +/** + * The minimum length of a GUID generated by the Evernote service + */ +const i32 EDAM_GUID_LEN_MIN = 36; +/** + * The maximum length of a GUID generated by the Evernote service + */ +const i32 EDAM_GUID_LEN_MAX = 36; +/** + * GUIDs generated by the Evernote service will match the provided pattern + */ +const string EDAM_GUID_REGEX = + "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"; + +/** + * The minimum length of any email address + */ +const i32 EDAM_EMAIL_LEN_MIN = 6; +/** + * The maximum length of any email address + */ +const i32 EDAM_EMAIL_LEN_MAX = 255; +/** + * A regular expression that matches the part of an email address before + * the '@' symbol. + */ +const string EDAM_EMAIL_LOCAL_REGEX = + "^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*$"; +/** + * A regular expression that matches the part of an email address after + * the '@' symbol. + */ +const string EDAM_EMAIL_DOMAIN_REGEX = + "^[A-Za-z0-9-]*[A-Za-z0-9](\\.[A-Za-z0-9-]*[A-Za-z0-9])*\\.([A-Za-z]{2,})$"; +/** + * A regular expression that must match any email address given to Evernote. + * Email addresses must comply with RFC 2821 and 2822. + */ +const string EDAM_EMAIL_REGEX = + "^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[A-Za-z0-9-]*[A-Za-z0-9](\\.[A-Za-z0-9-]*[A-Za-z0-9])*\\.([A-Za-z]{2,})$"; + +/** + * A regular expression that must match any VAT ID given to Evernote. + * ref http://en.wikipedia.org/wiki/VAT_identification_number + * ref http://my.safaribooksonline.com/book/programming/regular-expressions/9780596802837/4dot-validation-and-formatting/id2995136 + */ +const string EDAM_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]{7}[A-Z]{1,2}$|^(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)$"; + +/** + * The minimum length of a timezone specification string + */ +const i32 EDAM_TIMEZONE_LEN_MIN = 1; +/** + * The maximum length of a timezone specification string + */ +const i32 EDAM_TIMEZONE_LEN_MAX = 32; +/** + * Any timezone string given to Evernote must match the provided pattern. + * This permits either a locale-based standard timezone or a GMT offset. + * E.g.:
    + *
  • America/Los_Angeles
  • + *
  • GMT+08:00
  • + *
+ */ +const string EDAM_TIMEZONE_REGEX = + "^([A-Za-z_-]+(/[A-Za-z_-]+)*)|(GMT(-|\\+)[0-9]{1,2}(:[0-9]{2})?)$"; + +/** + * The minimum length of any MIME type string given to Evernote + */ +const i32 EDAM_MIME_LEN_MIN = 3; +/** + * The maximum length of any MIME type string given to Evernote + */ +const i32 EDAM_MIME_LEN_MAX = 255; +/** + * Any MIME type string given to Evernote must match the provided pattern. + * E.g.: image/gif + */ +const string EDAM_MIME_REGEX = "^[A-Za-z]+/[A-Za-z0-9._+-]+$"; + +/** Canonical MIME type string for GIF image resources */ +const string EDAM_MIME_TYPE_GIF = "image/gif"; +/** Canonical MIME type string for JPEG image resources */ +const string EDAM_MIME_TYPE_JPEG = "image/jpeg"; +/** Canonical MIME type string for PNG image resources */ +const string EDAM_MIME_TYPE_PNG = "image/png"; +/** Canonical MIME type string for TIFF image resources */ +const string EDAM_MIME_TYPE_TIFF = "image/tiff"; +/** Canonical MIME type string for BMP image resources */ +const string EDAM_MIME_TYPE_BMP = "image/bmp"; +/** Canonical MIME type string for WAV audio resources */ +const string EDAM_MIME_TYPE_WAV = "audio/wav"; +/** Canonical MIME type string for MP3 audio resources */ +const string EDAM_MIME_TYPE_MP3 = "audio/mpeg"; +/** Canonical MIME type string for AMR audio resources */ +const string EDAM_MIME_TYPE_AMR = "audio/amr"; +/** Canonical MIME type string for AAC audio resources */ +const string EDAM_MIME_TYPE_AAC = "audio/aac"; +/** Canonical MIME type string for MP4 audio resources */ +const string EDAM_MIME_TYPE_M4A = "audio/mp4"; +/** Canonical MIME type string for MP4 video resources */ +const string EDAM_MIME_TYPE_MP4_VIDEO = "video/mp4"; +/** Canonical MIME type string for Evernote Ink resources */ +const string EDAM_MIME_TYPE_INK = "application/vnd.evernote.ink"; +/** Canonical MIME type string for PDF resources */ +const string EDAM_MIME_TYPE_PDF = "application/pdf"; +/** MIME type used for attachments of an unspecified type */ +const string EDAM_MIME_TYPE_DEFAULT = "application/octet-stream"; + +/** + * The set of resource MIME types that are expected to be handled + * correctly by all of the major Evernote client applications. + */ +const set EDAM_MIME_TYPES = [ + EDAM_MIME_TYPE_GIF, + EDAM_MIME_TYPE_JPEG, + EDAM_MIME_TYPE_PNG, + EDAM_MIME_TYPE_WAV, + EDAM_MIME_TYPE_MP3, + EDAM_MIME_TYPE_AMR, + EDAM_MIME_TYPE_INK, + EDAM_MIME_TYPE_PDF, + EDAM_MIME_TYPE_MP4_VIDEO, + EDAM_MIME_TYPE_AAC, + EDAM_MIME_TYPE_M4A +]; + +/** + * The set of MIME types that Evernote will parse and index for + * searching. With exception of images, PDFs and plain text files, + * which are handled in a different way. + */ +const set EDAM_INDEXABLE_RESOURCE_MIME_TYPES = [ + "application/msword", + "application/mspowerpoint", + "application/excel", + "application/vnd.ms-word", + "application/vnd.ms-powerpoint", + "application/vnd.ms-excel", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "application/vnd.openxmlformats-officedocument.presentationml.presentation", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "application/vnd.apple.pages", + "application/vnd.apple.numbers", + "application/vnd.apple.keynote", + "application/x-iwork-pages-sffpages", + "application/x-iwork-numbers-sffnumbers", + "application/x-iwork-keynote-sffkey" +]; + +/** + * The set of plain text MIME types that Evernote will parse and index + * for searching. The MIME types which start with "text/" will be handled + * separately by each client (i.e. hard-coded in each client). + */ +const set EDAM_INDEXABLE_PLAINTEXT_MIME_TYPES = [ + "application/x-sh", + "application/x-bsh", + "application/sql", + "application/x-sql" +]; + +/** + * The minimum length of a user search query string in Unicode chars + */ +const i32 EDAM_SEARCH_QUERY_LEN_MIN = 0; +/** + * The maximum length of a user search query string in Unicode chars + */ +const i32 EDAM_SEARCH_QUERY_LEN_MAX = 1024; +/** + * Search queries must match the provided pattern. This is used for + * both ad-hoc queries and SavedSearch.query fields. + * This excludes all control characters and line/paragraph separators. + */ +const string EDAM_SEARCH_QUERY_REGEX = "^[^\\p{Cc}\\p{Zl}\\p{Zp}]{0,1024}$"; + +/** + * The exact length of a MD5 hash checksum, in binary bytes. + * This is the exact length that must be matched for any binary hash + * value. + */ +const i32 EDAM_HASH_LEN = 16; + +/** + * The minimum length of an Evernote username + */ +const i32 EDAM_USER_USERNAME_LEN_MIN = 1; +/** + * The maximum length of an Evernote username + */ +const i32 EDAM_USER_USERNAME_LEN_MAX = 64; +/** + * Any Evernote User.username field must match this pattern. This + * restricts usernames to a format that could permit use as a domain + * name component. E.g. "username.whatever.evernote.com" + */ +const string EDAM_USER_USERNAME_REGEX = "^[a-z0-9]([a-z0-9_-]{0,62}[a-z0-9])?$"; + +/** + * Minimum length of the User.name field + */ +const i32 EDAM_USER_NAME_LEN_MIN = 1; +/** + * Maximum length of the User.name field + */ +const i32 EDAM_USER_NAME_LEN_MAX = 255; +/** + * The User.name field must match this pattern, which excludes line + * endings and control characters. + */ +const string EDAM_USER_NAME_REGEX = "^[^\\p{Cc}\\p{Zl}\\p{Zp}]{1,255}$"; + +/** + * The minimum length of a Tag.name, in Unicode characters + */ +const i32 EDAM_TAG_NAME_LEN_MIN = 1; +/** + * The maximum length of a Tag.name, in Unicode characters + */ +const i32 EDAM_TAG_NAME_LEN_MAX = 100; +/** + * All Tag.name fields must match this pattern. + * This excludes control chars, commas or line/paragraph separators. + * The string may not begin or end with whitespace. + */ +const string EDAM_TAG_NAME_REGEX = + "^[^,\\p{Cc}\\p{Z}]([^,\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^,\\p{Cc}\\p{Z}])?$"; + +/** + * The minimum length of a Note.title, in Unicode characters + */ +const i32 EDAM_NOTE_TITLE_LEN_MIN = 1; +/** + * The maximum length of a Note.title, in Unicode characters + */ +const i32 EDAM_NOTE_TITLE_LEN_MAX = 255; +/** + * All Note.title fields must match this pattern. + * This excludes control chars or line/paragraph separators. + * The string may not begin or end with whitespace. + */ +const string EDAM_NOTE_TITLE_REGEX = + "^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,253}[^\\p{Cc}\\p{Z}])?$"; + +/** + * Minimum length of a Note.content field. + * Note.content fields must comply with the ENML DTD. + */ +const i32 EDAM_NOTE_CONTENT_LEN_MIN = 0; +/** + * Maximum length of a Note.content field + * Note.content fields must comply with the ENML DTD. + */ +const i32 EDAM_NOTE_CONTENT_LEN_MAX = 5242880; + +/** + * Minimum length of an application name, which is the key in an + * applicationData LazyMap found in entities such as Resources and + * Notes. + */ +const i32 EDAM_APPLICATIONDATA_NAME_LEN_MIN = 3; +/** + * Maximum length of an application name, which is the key in an + * applicationData LazyMap found in entities such as Resources and + * Notes. + */ +const i32 EDAM_APPLICATIONDATA_NAME_LEN_MAX = 32; +/** + * Minimum length of an applicationData value in a LazyMap, found + * in entities such as Resources and Notes. + */ +const i32 EDAM_APPLICATIONDATA_VALUE_LEN_MIN = 0; +/** + * Maximum length of an applicationData value in a LazyMap, found + * in entities such as Resources and Notes. Note, however, that + * the sum of the size of hte key and value is constrained by + * EDAM_APPLICATIONDATA_ENTRY_LEN_MAX, so the maximum length, in + * practice, depends upon the key value being used. + */ +const i32 EDAM_APPLICATIONDATA_VALUE_LEN_MAX = 4092; +/** + * The total length of an entry in an applicationData LazyMap, which + * is the sum of the length of the key and the value for the entry. + */ +const i32 EDAM_APPLICATIONDATA_ENTRY_LEN_MAX = 4095; +/** + * An application name must match this regex. An application + * name is the key portion of an entry in an applicationData + * map as found in entities such as Resources and Notes. + * Note that even if both the name and value regexes match, + * it is still necessary to check the sum of the lengths + * against EDAM_APPLICATIONDATA_ENTRY_LEN_MAX. + */ +const string EDAM_APPLICATIONDATA_NAME_REGEX = "^[A-Za-z0-9_.-]{3,32}$"; +/** + * An applicationData map value must match this regex. + * Note that even if both the name and value regexes match, + * it is still necessary to check the sum of the lengths + * against EDAM_APPLICATIONDATA_ENTRY_LEN_MAX. + */ +const string EDAM_APPLICATIONDATA_VALUE_REGEX = "^[\\p{Space}[^\\p{Cc}]]{0,4092}$"; + +/** + * The minimum length of a Notebook.name, in Unicode characters + */ +const i32 EDAM_NOTEBOOK_NAME_LEN_MIN = 1; +/** + * The maximum length of a Notebook.name, in Unicode characters + */ +const i32 EDAM_NOTEBOOK_NAME_LEN_MAX = 100; +/** + * All Notebook.name fields must match this pattern. + * This excludes control chars or line/paragraph separators. + * The string may not begin or end with whitespace. + */ +const string EDAM_NOTEBOOK_NAME_REGEX = + "^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^\\p{Cc}\\p{Z}])?$"; + +/** + * The minimum length of a Notebook.stack, in Unicode characters + */ +const i32 EDAM_NOTEBOOK_STACK_LEN_MIN = 1; +/** + * The maximum length of a Notebook.stack, in Unicode characters + */ +const i32 EDAM_NOTEBOOK_STACK_LEN_MAX = 100; +/** + * All Notebook.stack fields must match this pattern. + * This excludes control chars or line/paragraph separators. + * The string may not begin or end with whitespace. + */ +const string EDAM_NOTEBOOK_STACK_REGEX = + "^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^\\p{Cc}\\p{Z}])?$"; + +/** + * The minimum length of a Workspace.name, in Unicode characters + */ +const i32 EDAM_WORKSPACE_NAME_LEN_MIN = 1; + +/** + * The maximum length of a Workspace.name, in Unicode characters + */ +const i32 EDAM_WORKSPACE_NAME_LEN_MAX = 100; + +/** + * The maximum length of a Workspace.description, in Unicode characters + */ +const i32 EDAM_WORKSPACE_DESCRIPTION_LEN_MAX = 600; + +/** + * All Workspace.name fields must match this pattern. + * This excludes control chars or line/paragraph separators. + * The string may not begin or end with whitespace. + */ +const string EDAM_WORKSPACE_NAME_REGEX = + "^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^\\p{Cc}\\p{Z}])?$"; + +/** + * The minimum length of a public notebook URI component + */ +const i32 EDAM_PUBLISHING_URI_LEN_MIN = 1; +/** + * The maximum length of a public notebook URI component + */ +const i32 EDAM_PUBLISHING_URI_LEN_MAX = 255; +/** + * A public notebook URI component must match the provided pattern + */ +const string EDAM_PUBLISHING_URI_REGEX = "^[a-zA-Z0-9.~_+-]{1,255}$"; +/** + * The set of strings that may not be used as a publishing URI + */ +const set EDAM_PUBLISHING_URI_PROHIBITED = [ ".", ".." ]; + +/** + * The minimum length of a Publishing.publicDescription field. + */ +const i32 EDAM_PUBLISHING_DESCRIPTION_LEN_MIN = 1; +/** + * The maximum length of a Publishing.publicDescription field. + */ +const i32 EDAM_PUBLISHING_DESCRIPTION_LEN_MAX = 200; +/** + * Any public notebook's Publishing.publicDescription field must match + * this pattern. + * No control chars or line/paragraph separators, and can't start or + * end with whitespace. + */ +const string EDAM_PUBLISHING_DESCRIPTION_REGEX = + "^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,198}[^\\p{Cc}\\p{Z}])?$"; + +/** + * The minimum length of a SavedSearch.name field + */ +const i32 EDAM_SAVED_SEARCH_NAME_LEN_MIN = 1; +/** + * The maximum length of a SavedSearch.name field + */ +const i32 EDAM_SAVED_SEARCH_NAME_LEN_MAX = 100; +/** + * SavedSearch.name fields must match this pattern. + * No control chars or line/paragraph separators, and can't start or + * end with whitespace. + */ +const string EDAM_SAVED_SEARCH_NAME_REGEX = + "^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^\\p{Cc}\\p{Z}])?$"; + +/** + * The minimum length of an Evernote user password + */ +const i32 EDAM_USER_PASSWORD_LEN_MIN = 6; +/** + * The maximum length of an Evernote user password + */ +const i32 EDAM_USER_PASSWORD_LEN_MAX = 64; +/** + * Evernote user passwords must match this regular expression + */ +const string EDAM_USER_PASSWORD_REGEX = + "^[A-Za-z0-9!#$%&'()*+,./:;<=>?@^_`{|}~\\[\\]\\\\-]{6,64}$"; + +/** + * The maximum length of an Evernote Business URI + */ +const i32 EDAM_BUSINESS_URI_LEN_MAX = 32; + +/** + * Valid Evernote Business marketing code / affiliate code format. + */ +const string EDAM_BUSINESS_MARKETING_CODE_REGEX_PATTERN = "[A-Za-z0-9-]{1,128}"; + +// ==================== data model collection limits =========================== + +/** + * The maximum number of Tags per Note + */ +const i32 EDAM_NOTE_TAGS_MAX = 100; + +/** + * The maximum number of Resources per Note + */ +const i32 EDAM_NOTE_RESOURCES_MAX = 1000; + +/** + * Maximum number of Tags per account + */ +const i32 EDAM_USER_TAGS_MAX = 100000; + +/** + * Maximum number of Tags per business account. + */ +const i32 EDAM_BUSINESS_TAGS_MAX = 100000; + +/** + * Maximum number of SavedSearches per account + */ +const i32 EDAM_USER_SAVED_SEARCHES_MAX = 100; + +/** + * Maximum number of Notes per user + */ +const i32 EDAM_USER_NOTES_MAX = 100000; + +/** + * Maximum number of Notes per business account + */ +const i32 EDAM_BUSINESS_NOTES_MAX = 500000; + +/** + * Maximum number of Notebooks per user + */ +const i32 EDAM_USER_NOTEBOOKS_MAX = 250; + +/** + * Maximum number of Workspaces per user + */ +const i32 EDAM_USER_WORKSPACES_MAX = 0; + +/** + * Maximum number of Notebooks in a business account + */ +const i32 EDAM_BUSINESS_NOTEBOOKS_MAX = 10000; + +/** + * Maximum number of Workspaces in a business account + */ +const i32 EDAM_BUSINESS_WORKSPACES_MAX = 1000; + +/** + * Maximum number of recent email addresses that are maintained + * (see UserAttributes.recentMailedAddresses) + */ +const i32 EDAM_USER_RECENT_MAILED_ADDRESSES_MAX = 10; + +/** + * The number of emails of any type that can be sent by a user with a Free + * account from the service per day. If an email is sent to two different + * recipients, this counts as two emails. + */ +const i32 EDAM_USER_MAIL_LIMIT_DAILY_FREE = 50; + +/** + * The number of emails of any type that can be sent by a user with a Premium + * account from the service per day. If an email is sent to two different + * recipients, this counts as two emails. + */ +const i32 EDAM_USER_MAIL_LIMIT_DAILY_PREMIUM = 200; + +/** + * The number of bytes of new data that may be uploaded to a Free user's + * account each month. + */ +const i64 EDAM_USER_UPLOAD_LIMIT_FREE = 62914560; + +/** + * The number of bytes of new data that may be uploaded to a Premium user's + * account each month. + */ +const i64 EDAM_USER_UPLOAD_LIMIT_PREMIUM = 10737418240; + +/** + * The number of bytes of new data that may be uploaded to new business + * account during the first month. 50GB. + */ +const i64 EDAM_USER_UPLOAD_LIMIT_BUSINESS_FIRST_MONTH = 53687091200; + +/** + * The number of bytes of new data that may be uploaded to a business + * account for the next month. 20GB. + */ +const i64 EDAM_USER_UPLOAD_LIMIT_BUSINESS_NEXT_MONTH = 21474836480; + +/** + * The number of bytes of new data that may be uploaded each month to an account at + * a Plus service level. + */ +const i64 EDAM_USER_UPLOAD_LIMIT_PLUS = 1073741824; + +/** + * The number of bytes of new data uploaded in a monthly quota cycle at which point + * users should be prompted with a survey to gather information on how they are using + * Evernote. + */ +const i64 EDAM_USER_UPLOAD_SURVEY_THRESHOLD = 5368709120; + +/** + * The number of bytes of new data that may be uploaded to a Business user's + * personal account each month. Note that content uploaded into the Business + * notebooks by the user does not count against this limit. + */ +const i64 EDAM_USER_UPLOAD_LIMIT_BUSINESS = 10737418240; + +/** + * The number of bytes of new data that may be uploaded to a Business for each + * member of the business per month. The total bytes available can be determined + * by multiplying this with the number of business users. + */ +const i64 EDAM_USER_UPLOAD_LIMIT_BUSINESS_PER_USER = 2147483647; + +/** + * Maximum total size of a Note that can be added to a Free account. + * The size of a note is calculated as: + * ENML content length (in Unicode characters) plus the sum of all resource + * sizes (in bytes). + */ +const i32 EDAM_NOTE_SIZE_MAX_FREE = 26214400; + +/** + * Maximum total size of a Note that can be added to a Premium account. + * The size of a note is calculated as: + * ENML content length (in Unicode characters) plus the sum of all resource + * sizes (in bytes). + */ +const i32 EDAM_NOTE_SIZE_MAX_PREMIUM = 209715200; + +/** + * Maximum size of a resource, in bytes, for Free accounts + */ +const i32 EDAM_RESOURCE_SIZE_MAX_FREE = 26214400; + +/** + * Maximum size of a resource, in bytes, for Premium accounts + */ +const i32 EDAM_RESOURCE_SIZE_MAX_PREMIUM = 209715200; + +/** + * Maximum number of linked notebooks per account, for a free + * account. + */ +const i32 EDAM_USER_LINKED_NOTEBOOK_MAX = 100; + +/** + * Maximum number of linked notebooks per account, for a premium + * account. Users who are part of an active business are also + * covered under "premium". + */ +const i32 EDAM_USER_LINKED_NOTEBOOK_MAX_PREMIUM = 500; + +/** + * Maximum number of shared notebooks per business notebook + */ +const i32 EDAM_NOTEBOOK_BUSINESS_SHARED_NOTEBOOK_MAX = 5000; +/** + * Maximum number of shared notebooks per personal notebook + */ +const i32 EDAM_NOTEBOOK_PERSONAL_SHARED_NOTEBOOK_MAX = 500; + +/** + * Maximum number of SharedNote records per business note + */ +const i32 EDAM_NOTE_BUSINESS_SHARED_NOTE_MAX = 1000; +/** + * Maximum number of SharedNote records per personal note + */ +const i32 EDAM_NOTE_PERSONAL_SHARED_NOTE_MAX = 100; + +/** + * The minimum length of the content class attribute of a note. + */ +const i32 EDAM_NOTE_CONTENT_CLASS_LEN_MIN = 3; +/** + * The maximum length of the content class attribute of a note. + */ +const i32 EDAM_NOTE_CONTENT_CLASS_LEN_MAX = 32; +/** + * The regular expression that the content class of a note must match + * to be valid. + */ +const string EDAM_NOTE_CONTENT_CLASS_REGEX = "^[A-Za-z0-9_.-]{3,32}$"; +/** + * The content class prefix used for all notes created by Evernote Hello. + * This prefix can be used to assemble individual content class strings, + * or can be used to create a wildcard search to get all notes created by + * Hello. When performing a wildcard search via filtered sync chunks or + * search strings, the * character must be appended to this constant. + */ +const string EDAM_HELLO_APP_CONTENT_CLASS_PREFIX = "evernote.hello."; +/** + * The content class prefix used for all notes created by Evernote Food. + * This prefix can be used to assemble individual content class strings, + * or can be used to create a wildcard search to get all notes created by + * Food. When performing a wildcard search via filtered sync chunks or + * search strings, the * character must be appended to this constant. + */ +const string EDAM_FOOD_APP_CONTENT_CLASS_PREFIX = "evernote.food."; +/** + * The content class prefix used for structured notes created by Evernote + * Hello that represents an encounter with a person. When performing a + * wildcard search via filtered sync chunks or search strings, the * + * character must be appended to this constant. + */ +const string EDAM_CONTENT_CLASS_HELLO_ENCOUNTER = "evernote.hello.encounter"; +/** + * The content class prefix used for structured notes created by Evernote + * Hello that represents the user's profile. When performing a + * wildcard search via filtered sync chunks or search strings, the * + * character must be appended to this constant. + */ +const string EDAM_CONTENT_CLASS_HELLO_PROFILE = "evernote.hello.profile"; +/** + * The content class prefix used for structured notes created by + * Evernote Food that captures the experience of a particular meal. + * When performing a wildcard search via filtered sync chunks or search + * strings, the * character must be appended to this constant. + */ +const string EDAM_CONTENT_CLASS_FOOD_MEAL = "evernote.food.meal"; + +/** + * The content class prefix used for structured notes created by Evernote + * Skitch. When performing a wildcard search via filtered sync chunks + * or search strings, the * character must be appended to this constant. + */ +const string EDAM_CONTENT_CLASS_SKITCH_PREFIX = "evernote.skitch"; + +/** + * The content class value used for structured image notes created by Evernote + * Skitch. + */ +const string EDAM_CONTENT_CLASS_SKITCH = "evernote.skitch"; + +/** + * The content class value used for structured PDF notes created by Evernote + * Skitch. + */ +const string EDAM_CONTENT_CLASS_SKITCH_PDF = "evernote.skitch.pdf"; + +/** + * The content class prefix used for structured notes created by Evernote + * Penultimate. When performing a wildcard search via filtered sync chunks + * or search strings, the * character must be appended to this constant. + */ +const string EDAM_CONTENT_CLASS_PENULTIMATE_PREFIX = "evernote.penultimate."; + +/** + * The content class value used for structured notes created by Evernote + * Penultimate that represents a Penultimate notebook. + */ +const string EDAM_CONTENT_CLASS_PENULTIMATE_NOTEBOOK = "evernote.penultimate.notebook"; + +/** + * The NoteAttributes.sourceApplication value used for notes captured by the Post-it + * camera. + */ +const string EDAM_SOURCE_APPLICATION_POSTIT = "postit"; + +/** + * The NoteAttributes.sourceApplication value used for notes captured by the Moleskine + * page camera. + */ +const string EDAM_SOURCE_APPLICATION_MOLESKINE = "moleskine"; + +/** + * The NoteAttributes.sourceApplication value used for notes captured by + * PFU ScanSnap Evernote Edition. + */ +const string EDAM_SOURCE_APPLICATION_EN_SCANSNAP = "scanner.scansnap.evernote"; + +/** + * The NoteAttributes.sourceApplication value used for notes captured with the Embedded + * Web Clipper. + */ +const string EDAM_SOURCE_APPLICATION_EWC = "clipncite.web"; + +/** + * The NoteAttributes.sourceApplication value used for notes captured with the Android + * share extension. + */ +const string EDAM_SOURCE_APPLICATION_ANDROID_SHARE_EXTENSION = "android.clipper.evernote"; + +/** + * The NoteAttributes.sourceApplication value used for notes captured with the iOS share + * extension. + */ +const string EDAM_SOURCE_APPLICATION_IOS_SHARE_EXTENSION = "ios.clipper.evernote"; + +/** + * The NoteAttributes.sourceApplication value used for notes captured with the Evernote + * Web Clipper. + */ +const string EDAM_SOURCE_APPLICATION_WEB_CLIPPER = "webclipper.evernote"; + +/** + * The NoteAttributes.source value used for notes captured by the Microsoft Outlook clipper. + */ +const string EDAM_SOURCE_OUTLOOK_CLIPPER = "app.ms.outlook"; + +/** + * A NoteAttributes.noteTitleQuality value indicating that a note has no meaningful title, + * only a placeholder value such as "Untitled Note". + */ +const i32 EDAM_NOTE_TITLE_QUALITY_UNTITLED = 0; + +/** + * A NoteAttributes.noteTitleQuality value indicating that the quality of an automatically + * generated note title is low. Examples of low quality titles include those based on a + * note's type and location, such as "Snapshot from 123 Sesame Street in New York". + */ +const i32 EDAM_NOTE_TITLE_QUALITY_LOW = 1; + +/** + * A NoteAttributes.noteTitleQuality value indicating that the quality of an automatically + * generated note title is medium. Examples of medium quality titles include those based on a + * calendar entry, such as "Note from Weekly Staff Meeting". + */ +const i32 EDAM_NOTE_TITLE_QUALITY_MEDIUM = 2; + +/** + * A NoteAttributes.noteTitleQuality value indicating that the quality of an automatically + * generated note title is high. Examples of high quality titles include those based on a + * scanned business card, such as "John Doe - Scanned Business Card". + */ +const i32 EDAM_NOTE_TITLE_QUALITY_HIGH = 3; + +/** + * The minimum length of the plain text in a findRelated query, assuming that + * plaintext is being provided. + */ +const i32 EDAM_RELATED_PLAINTEXT_LEN_MIN = 1; + +/** + * The maximum length of the plain text in a findRelated query, assuming that + * plaintext is being provided. + */ +const i32 EDAM_RELATED_PLAINTEXT_LEN_MAX = 131072; + +/** + * The maximum number of notes that will be returned from a findRelated() + * query. + */ +const i32 EDAM_RELATED_MAX_NOTES = 25; + +/** + * The maximum number of notebooks that will be returned from a findRelated() + * query. + */ +const i32 EDAM_RELATED_MAX_NOTEBOOKS = 1; + +/** + * The maximum number of tags that will be returned from a findRelated() query. + */ +const i32 EDAM_RELATED_MAX_TAGS = 25; + +/** + * The maximum number of experts that will be returned from a findRelated() query + */ +const i32 EDAM_RELATED_MAX_EXPERTS = 10; + +/** + * The maximum number of related content snippets that will be returned from a + * findRelated() query. + */ +const i32 EDAM_RELATED_MAX_RELATED_CONTENT = 10; + +/** + * The minimum length, in Unicode characters, of a description for a business + * notebook. + */ +const i32 EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MIN = 1; + +/** + * The maximum length, in Unicode characters, of a description for a business + * notebook. + */ +const i32 EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MAX = 200; +/** + * All business notebook descriptions must match this pattern. + * This excludes control chars or line/paragraph separators. + * The string may not begin or end with whitespace. + */ +const string EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_REGEX = + "^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,198}[^\\p{Cc}\\p{Z}])?$"; + +/** + * The maximum length of a business phone number. + */ +const i32 EDAM_BUSINESS_PHONE_NUMBER_LEN_MAX = 20; + +/** + * Minimum length of a preference name + */ +const i32 EDAM_PREFERENCE_NAME_LEN_MIN = 3; +/** + * Maximum length of a preference name + */ +const i32 EDAM_PREFERENCE_NAME_LEN_MAX = 32; +/** + * Minimum length of a preference value + */ +const i32 EDAM_PREFERENCE_VALUE_LEN_MIN = 1; +/** + * Maximum length of a preference value + */ +const i32 EDAM_PREFERENCE_VALUE_LEN_MAX = 1024; +/** + * Maximum number of name/value pairs allowed + */ +const i32 EDAM_MAX_PREFERENCES = 100; +/** + * Maximum number of values per preference name when using + * values of size no greater than EDAM_PREFERENCE_VALUE_LEN_MAX. + */ +const i32 EDAM_MAX_VALUES_PER_PREFERENCE = 256; +/** + * The maximum length of a preference value if you only use one value + * per preference rather than up to EDAM_MAX_VALUES_PER_PREFERENCE. + * This option is useful if you want a single string that is larger + * than EDAM_PREFERENCE_VALUE_LEN_MAX and would otherwise need to + * split the string into multiple pieces to store it. + */ +const i32 EDAM_PREFERENCE_ONLY_ONE_VALUE_LEN_MAX = 16384; +/** + * A preference name must match this regex. + */ +const string EDAM_PREFERENCE_NAME_REGEX = "^[A-Za-z0-9_.-]{3,32}$"; +/** + * A preference value must match this regex if you are using more + * than a single value for a preference. + */ +const string EDAM_PREFERENCE_VALUE_REGEX = "^[^\\p{Cc}]{1,1024}$"; +/** + * A preference value must match this regex if you are using a single + * value for a preference. + */ +const string EDAM_PREFERENCE_ONLY_ONE_VALUE_REGEX = "^[^\\p{Cc}]{1,16384}$"; +/** + * The name of the preferences entry that contains shortcuts. + */ +const string EDAM_PREFERENCE_SHORTCUTS = "evernote.shortcuts"; +/** + * The name of the preferences entry that contains the notebook GUID (not the linked notebook) of + * the default business notebook. It must be in the format EDAM_GUID_REGEX. + * If a default business notebook is not set and the user is a business user + * the user should be prompted to set the default business notebook. + * The default business notebook must be a read/write notebook. + * Whenever the default business notebook guid is used, it must be revalidiated as a writable + * notebook. If it is not valid, the user should be re-prompted to set the value. + * This value is used by clients only. + */ +const string EDAM_PREFERENCE_BUSINESS_DEFAULT_NOTEBOOK = "evernote.business.notebook"; +/** + * The name of the preferences entry that contains a boolean indicating that default + * quicknotes should go into a business notebook. The EDAM_PREFERENCE_BUSINESS_DEFAULT_NOTEBOOK + * must be set correctly for this preference to be honored. + * The quicknote preferences should only be set to "true", if quicknote should use a business + * notebook. + * Any value other than "true" (or the omission of a value) should be treated as "false". + * In this case, quicknotes should be created in in the user's personal default notebook. + * The interface should not allow users to set quicknote to a business notebook + * without a valid default business notebook selected, however, clients should handle the edge + * case of an invalid business notebook guid. If a user stops being a business user or + * does not have write access to any business notebooks the quicknote preference should be + * ignored. + */ +const string EDAM_PREFERENCE_BUSINESS_QUICKNOTE = "evernote.business.quicknote"; +/** + * The maximum number of shortcuts that a user may have. + */ +const i32 EDAM_PREFERENCE_SHORTCUTS_MAX_VALUES = 250; +/** + * Maximum length of the device identifier string associated with long sessions. + */ +const i32 EDAM_DEVICE_ID_LEN_MAX = 32; +/** + * Regular expression for device identifier strings associated with long sessions. + */ +const string EDAM_DEVICE_ID_REGEX = "^[^\\p{Cc}]{1,32}$"; +/** + * Maximum length of the device description string associated with long sessions. + */ +const i32 EDAM_DEVICE_DESCRIPTION_LEN_MAX = 64; +/** + * Regular expression for device description strings associated with long sessions. + */ +const string EDAM_DEVICE_DESCRIPTION_REGEX = "^[^\\p{Cc}]{1,64}$"; + +/** + * Maximum number of search suggestions that can be returned + */ +const i32 EDAM_SEARCH_SUGGESTIONS_MAX = 10; + +/** + * Maximum length of the search suggestion prefix + */ +const i32 EDAM_SEARCH_SUGGESTIONS_PREFIX_LEN_MAX = 1024; + +/** + * Minimum length of the search suggestion prefix + */ +const i32 EDAM_SEARCH_SUGGESTIONS_PREFIX_LEN_MIN = 2; + +/** + * Default maximum number of results the service will return for findContact + */ +const i32 EDAM_FIND_CONTACT_DEFAULT_MAX_RESULTS = 100; + +/** + * Absolute maximum number of results the service will return for findContact + */ +const i32 EDAM_FIND_CONTACT_MAX_RESULTS = 256; + +/** + * The maximum number of separate notes that may be queried in a single call to + * NoteStore.getViewersForNotes. + */ +const i32 EDAM_NOTE_LOCK_VIEWERS_NOTES_MAX = 150; + +/** + * Absolute maximum number of results the servce will return for PersistentInternalMarket.getOrders() + */ +const i32 EDAM_GET_ORDERS_MAX_RESULTS = 2000; + +/** + * The maximum length of a message body in unicode characters. + */ +const i32 EDAM_MESSAGE_BODY_LEN_MAX = 2048; + +/** + * The regex to validate message.body against + */ +const string EDAM_MESSAGE_BODY_REGEX = "^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,2046}[^\\p{Cc}\\p{Z}])?$"; + +/** + * The maximum number of recipients on a MessageThread. + */ +const i32 EDAM_MESSAGE_RECIPIENTS_MAX = 50; + +/** + * The maximum number of attachments a Message can have. + */ +const i32 EDAM_MESSAGE_ATTACHMENTS_MAX = 100; + +/** + * The maximum length of a message attachment title in unicode characters. + */ +const i32 EDAM_MESSAGE_ATTACHMENT_TITLE_LEN_MAX = 255; + +/** + * The regex to validate message attachment titles against + */ +const string EDAM_MESSAGE_ATTACHMENT_TITLE_REGEX = "^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,253}[^\\p{Cc}\\p{Z}])?$"; + +/** + * The maximum length of a message attachment snippet in unicode characters. + */ +const i32 EDAM_MESSAGE_ATTACHMENT_SNIPPET_LEN_MAX = 2048; + +/** + * The regex to validate message attachment snippets against + */ +const string EDAM_MESSAGE_ATTACHMENT_SNIPPET_REGEX = "^[^\\p{Cc}\\p{Z}]([\\n[^\\p{Cc}\\p{Zl}\\p{Zp}]]{0,2046}[^\\p{Cc}\\p{Z}])?$"; + +/** + * Maximum user profile photo size, in bytes, that clients may send to the service. + * Photos may be resized before being stored on the service. + */ +const i32 EDAM_USER_PROFILE_PHOTO_MAX_BYTES = 716800; + +/** + * The maximum length of a promotion ID in unicode characters. + */ +const i32 EDAM_PROMOTION_ID_LEN_MAX = 32; + +/** + * The regex to validate promotion IDs against. + */ +const string EDAM_PROMOTION_ID_REGEX = "^[A-Za-z0-9_.-]{1,32}$"; + +/** App Feedback Rating range */ +const i16 EDAM_APP_RATING_MIN = 1; +const i16 EDAM_APP_RATING_MAX = 5; + +/** + * The maximium number of note snippets you can retrieve in a single request + */ +const i32 EDAM_SNIPPETS_NOTES_MAX = 24; + +/** + * The maximum number of connected identities a client can request. + */ +const i32 EDAM_CONNECTED_IDENTITY_REQUEST_MAX = 100; + + /** + * Maximum length for OpenID token. There is no official enforced limit. The length of the Token ID depends + * on the provider. 1000 seems to be the safest value at this time. + */ +const i32 EDAM_OPEN_ID_ACCESS_TOKEN_MAX = 1000; + diff --git a/tests/evernote-thrift/src/NoteStore.thrift b/tests/evernote-thrift/src/NoteStore.thrift new file mode 100644 index 0000000..2ab704e --- /dev/null +++ b/tests/evernote-thrift/src/NoteStore.thrift @@ -0,0 +1,4181 @@ +/* + * Copyright 2007-2018 Evernote Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file contains the EDAM protocol interface for operations to access and modify the contents + * of an Evernote user account such as Notes, Notebooks and Tags. + */ + +include "UserStore.thrift" +include "Types.thrift" +include "Errors.thrift" +include "Limits.thrift" + +namespace as3 com.evernote.edam.notestore +namespace java com.evernote.edam.notestore +namespace csharp Evernote.EDAM.NoteStore +namespace py evernote.edam.notestore +namespace cpp evernote.edam +namespace rb Evernote.EDAM.NoteStore +namespace php EDAM.NoteStore +namespace cocoa EDAM +namespace perl EDAMNoteStore +namespace go edam + +/** + * This structure encapsulates the information about the state of the + * user's account for the purpose of "state based" synchronization. + *
+ *
currentTime
+ *
+ * The server's current date and time. + *
+ *
fullSyncBefore
+ *
+ * The cutoff date and time for client caches to be + * updated via incremental synchronization. Any clients that were last + * synched with the server before this date/time must do a full resync of all + * objects. This cutoff point will change over time as archival data is + * deleted or special circumstances on the service require resynchronization. + *
+ *
updateCount
+ *
+ * Indicates the total number of transactions that have + * been committed within the account. This reflects (for example) the + * number of discrete additions or modifications that have been made to + * the data in this account (tags, notes, resources, etc.). + * This number is the "high water mark" for Update Sequence Numbers (USN) + * within the account. + *
+ *
uploaded
+ *
+ * The total number of bytes that have been uploaded to + * this account in the current monthly period. This can be compared against + * Accounting.uploadLimit (from the UserStore) to determine how close the user + * is to their monthly upload limit. + * This value may not be present if the SyncState has been retrieved by + * a caller that only has read access to the account. + *
+ *
userLastUpdated
+ *
+ * The last time when a user's account level information was changed. This value + * is the latest time when a modification was made to any of the following: + * accounting information (billing, quota, premium status, etc.), user attributes + * and business user information (business name, business user attributes, etc.) if + * the user is in a business. + * Clients who need to maintain account information about a User should watch this + * field for updates rather than polling UserStore.getUser for updates. Here is the + * basic flow that clients should follow: + *
    + *
  1. Call NoteStore.getSyncState to retrieve the SyncState object
  2. + *
  3. Compare SyncState.userLastUpdated to previously stored value: + * if (SyncState.userLastUpdated > previousValue) + * call UserStore.getUser to get the latest User object; + * else + * do nothing;
  4. + *
  5. Update previousValue = SyncState.userLastUpdated
  6. + *
+ *
+ *
userMaxMessageEventId
+ *
+ * The greatest MessageEventID for this user's account. Clients that do a full + * sync should store this value locally and compare their local copy to the + * value returned by getSyncState to determine if they need to sync with + * MessageStore. This value will be omitted if the user has never sent or + * received a message. + *
+ *
+ */ +struct SyncState { + 1: required Types.Timestamp currentTime, + 2: required Types.Timestamp fullSyncBefore, + 3: required i32 updateCount, + 4: optional i64 uploaded, + 5: optional Types.Timestamp userLastUpdated, + 6: optional Types.MessageEventID userMaxMessageEventId, +} + +/** + * This structure is given out by the NoteStore when a client asks to + * receive the current state of an account. The client asks for the server's + * state one chunk at a time in order to allow clients to retrieve the state + * of a large account without needing to transfer the entire account in + * a single message. + * + * The server always gives SyncChunks using an ascending series of Update + * Sequence Numbers (USNs). + * + *
+ *
currentTime
+ *
+ * The server's current date and time. + *
+ * + *
chunkHighUSN
+ *
+ * The highest USN for any of the data objects represented + * in this sync chunk. If there are no objects in the chunk, this will not be + * set. + *
+ * + *
updateCount
+ *
+ * The total number of updates that have been performed in + * the service for this account. This is equal to the highest USN within the + * account at the point that this SyncChunk was generated. If updateCount + * and chunkHighUSN are identical, that means that this is the last chunk + * in the account ... there is no more recent information. + *
+ * + *
notes
+ *
+ * If present, this is a list of non-expunged notes that + * have a USN in this chunk. This will include notes that are "deleted" + * but not expunged (i.e. in the trash). The notes will include their list + * of tags and resources, but the note content, resource content, resource + * recognition data and resource alternate data will not be supplied. + *
+ * + *
notebooks
+ *
+ * If present, this is a list of non-expunged notebooks that + * have a USN in this chunk. + *
+ * + *
tags
+ *
+ * If present, this is a list of the non-expunged tags that have a + * USN in this chunk. + *
+ * + *
searches
+ *
+ * If present, this is a list of non-expunged searches that + * have a USN in this chunk. + *
+ * + *
resources
+ *
+ * If present, this is a list of the non-expunged resources + * that have a USN in this chunk. This will include the metadata for each + * resource, but not its binary contents or recognition data, which must be + * retrieved separately. + *
+ * + *
expungedNotes
+ *
+ * If present, the GUIDs of all of the notes that were + * permanently expunged in this chunk. + *
+ * + *
expungedNotebooks
+ *
+ * If present, the GUIDs of all of the notebooks that + * were permanently expunged in this chunk. When a notebook is expunged, + * this implies that all of its child notes (and their resources) were + * also expunged. + *
+ * + *
expungedTags
+ *
+ * If present, the GUIDs of all of the tags that were + * permanently expunged in this chunk. + *
+ * + *
expungedSearches
+ *
+ * If present, the GUIDs of all of the saved searches + * that were permanently expunged in this chunk. + *
+ * + *
linkedNotebooks
+ *
+ * If present, this is a list of non-expunged LinkedNotebooks that + * have a USN in this chunk. + *
+ * + *
expungedLinkedNotebooks
+ *
+ * If present, the GUIDs of all of the LinkedNotebooks + * that were permanently expunged in this chunk. + *
+ */ +struct SyncChunk { + 1: required Types.Timestamp currentTime, + 2: optional i32 chunkHighUSN, + 3: required i32 updateCount, + 4: optional list notes, + 5: optional list notebooks, + 6: optional list tags, + 7: optional list searches, + 8: optional list resources, + 9: optional list expungedNotes, + 10: optional list expungedNotebooks, + 11: optional list expungedTags, + 12: optional list expungedSearches, + 13: optional list linkedNotebooks, + 14: optional list expungedLinkedNotebooks +} + +/** + * This structure is used with the 'getFilteredSyncChunk' call to provide + * fine-grained control over the data that's returned when a client needs + * to synchronize with the service. Each flag in this structure specifies + * whether to include one class of data in the results of that call. + * + *
+ *
includeNotes
+ *
+ * If true, then the server will include the SyncChunks.notes field + *
+ * + *
includeNoteResources
+ *
+ * If true, then the server will include the 'resources' field on all of + * the Notes that are in SyncChunk.notes. + * If 'includeNotes' is false, then this will have no effect. + *
+ * + *
includeNoteAttributes
+ *
+ * If true, then the server will include the 'attributes' field on all of + * the Notes that are in SyncChunks.notes. + * If 'includeNotes' is false, then this will have no effect. + *
+ * + *
includeNotebooks
+ *
+ * If true, then the server will include the SyncChunks.notebooks field + *
+ * + *
includeTags
+ *
+ * If true, then the server will include the SyncChunks.tags field + *
+ * + *
includeSearches
+ *
+ * If true, then the server will include the SyncChunks.searches field + *
+ * + *
includeResources
+ *
+ * If true, then the server will include the SyncChunks.resources field. + * Since the Resources are also provided with their Note + * (in the Notes.resources list), this is primarily useful for clients that + * want to watch for changes to individual Resources due to recognition data + * being added. + *
+ * + *
includeLinkedNotebooks
+ *
+ * If true, then the server will include the SyncChunks.linkedNotebooks field. + *
+ * + *
includeExpunged
+ *
+ * If true, then the server will include the 'expunged' data for any type + * of included data. For example, if 'includeTags' and 'includeExpunged' + * are both true, then the SyncChunks.expungedTags field will be set with + * the GUIDs of tags that have been expunged from the server. + *
+ * + *
includeNoteApplicationDataFullMap
+ *
+ * If true, then the values for the applicationData map will be filled + * in, assuming notes and note attributes are being returned. Otherwise, + * only the keysOnly field will be filled in. + *
+ * + *
includeResourceApplicationDataFullMap
+ *
+ * If true, then the fullMap values for the applicationData map will be + * filled in, assuming resources and resource attributes are being returned + * (includeResources is true). Otherwise, only the keysOnly field will be + * filled in. + *
+ * + *
includeNoteResourceApplicationDataFullMap
+ *
+ * If true, then the fullMap values for the applicationData map will be + * filled in for resources found inside of notes, assuming resources are + * being returned in notes (includeNoteResources is true). Otherwise, + * only the keysOnly field will be filled in. + *
+ * + *
omitSharedNotebooks
+ *
+ * Normally, if 'includeNotebooks' is true, then the SyncChunks will + * include Notebooks that may include a set of SharedNotebook + * invitations via Notebook.sharedNotebookIds and Notebook.sharedNotebooks. + * However, if omitSharedNotebooks is set to true, then the Notebooks + * will omit those two fields and leave them unset. This should be used + * by clients who want to know their own set of Notebooks (and the + * associated permissions via Notebook.recipientSettings), and who + * do not need to know the full set of other people who can also see + * that same notebook. + *
+ * + *
requireNoteContentClass
+ *
+ * If set, then only send notes whose content class matches this value. + * The value can be a literal match or, if the last character is an + * asterisk, a prefix match. + *
+ * + *
notebookGuids
+ *
+ * If set, then restrict the returned notebooks, notes, and + * resources to those associated with one of the notebooks whose + * GUID is provided in this list. If not set, then no filtering on + * notebook GUID will be performed. If you set this field, you may + * not also set includeExpunged else an EDAMUserException with an + * error code of DATA_CONFLICT will be thrown. You only need to set + * this field if you want to restrict the returned entities more + * than what your authentication token allows you to access. For + * example, there is no need to set this field for single notebook + * tokens such as for shared notebooks. You can use this field to + * synchronize a newly discovered business notebook while + * incrementally synchronizing a business account, in which case you + * will only need to consider setting includeNotes, + * includeNotebooks, includeNoteAttributes, includeNoteResources, + * and maybe some of the "FullMap" fields. + *
+ * + *
includeSharedNotes
+ *
+ * If true, then the service will include the sharedNotes field on all + * notes that are in SyncChunk.notes. If 'includeNotes' is false, then + * this will have no effect. + *
+ *
+ */ +struct SyncChunkFilter { + 1: optional bool includeNotes, + 2: optional bool includeNoteResources, + 3: optional bool includeNoteAttributes, + 4: optional bool includeNotebooks, + 5: optional bool includeTags, + 6: optional bool includeSearches, + 7: optional bool includeResources, + 8: optional bool includeLinkedNotebooks, + 9: optional bool includeExpunged, + 10: optional bool includeNoteApplicationDataFullMap, + 12: optional bool includeResourceApplicationDataFullMap, + 13: optional bool includeNoteResourceApplicationDataFullMap, + 17: optional bool includeSharedNotes, + 16: optional bool omitSharedNotebooks, + 11: optional string requireNoteContentClass, + 15: optional set notebookGuids +} + + +/** + * A list of criteria that are used to indicate which notes are desired from + * the account. This is used in queries to the NoteStore to determine + * which notes should be retrieved. + * + *
+ *
order
+ *
+ * The NoteSortOrder value indicating what criterion should be + * used to sort the results of the filter. + *
+ * + *
ascending
+ *
+ * If true, the results will be ascending in the requested + * sort order. If false, the results will be descending. + *
+ * + *
words
+ *
+ * If present, a search query string that will filter the set of notes to be returned. + * Accepts the full search grammar documented in the Evernote API Overview. + *
+ * + *
notebookGuid
+ *
+ * If present, the Guid of the notebook that must contain + * the notes. + *
+ * + *
tagGuids
+ *
+ * If present, the list of tags (by GUID) that must be present + * on the notes. + *
+ * + *
timeZone
+ *
+ * The zone ID for the user, which will be used to interpret + * any dates or times in the queries that do not include their desired zone + * information. + * For example, if a query requests notes created "yesterday", this + * will be evaluated from the provided time zone, if provided. + * The format must be encoded as a standard zone ID such as + * "America/Los_Angeles". + *
+ * + *
inactive
+ *
+ * If true, then only notes that are not active (i.e. notes in + * the Trash) will be returned. Otherwise, only active notes will be returned. + * There is no way to find both active and inactive notes in a single query. + *
+ * + *
emphasized
+ *
+ * If present, a search query string that may or may not influence the notes + * to be returned, both in terms of coverage as well as of order. Think of it + * as a wish list, not a requirement. + * Accepts the full search grammar documented in the Evernote API Overview. + *
+ * + *
includeAllReadableNotebooks
+ *
+ * If true, then the search will include all business notebooks that are readable + * by the user. A business authentication token must be supplied for + * this option to take effect when calling search APIs. + *
+ * + *
includeAllReadableWorkspaces
+ *
+ * If true, then the search will include all workspaces that are readable + * by the user. A business authentication token must be supplied for + * this option to take effect when calling search APIs. + *
+ * + *
context
+ *
+ * Specifies the context to consider when determining result ranking. + * Clients must leave this value unset unless they wish to explicitly specify a known + * non-default context. + *
+ * + *
rawWords
+ *
+ * If present, the raw user query input. + * Accepts the full search grammar documented in the Evernote API Overview. + *
+ * + *
searchContextBytes
+ *
+ * Specifies the correlating information about the current search session, in byte array. + * If this request is not for the first page of search results, the client should populate + * this field with the value of searchContextBytes from the NotesMetadataList of the + * original search response. + *
+ *
+ */ +struct NoteFilter { + // 1: optional Types.NoteSortOrder order, + 1: optional i32 order, // Should be one of the NoteSortOrder values + 2: optional bool ascending, + 3: optional string words, + 4: optional Types.Guid notebookGuid, + 5: optional list tagGuids, + 6: optional string timeZone, + 7: optional bool inactive, + 8: optional string emphasized, + 9: optional bool includeAllReadableNotebooks, + 15: optional bool includeAllReadableWorkspaces, + 10: optional string context, + 11: optional string rawWords, + 12: optional binary searchContextBytes, +} + +/** + * A small structure for returning a list of notes out of a larger set. + * + *
+ *
startIndex
+ *
+ * The starting index within the overall set of notes. This + * is also the number of notes that are "before" this list in the set. + *
+ * + *
totalNotes
+ *
+ * The number of notes in the larger set. This can be used + * to calculate how many notes are "after" this note in the set. + * (I.e. remaining = totalNotes - (startIndex + notes.length) ) + *
+ * + *
notes
+ *
+ * The list of notes from this range. The Notes will include all + * metadata (attributes, resources, etc.), but will not include the ENML + * content of the note or the binary contents of any resources. + *
+ * + *
stoppedWords
+ *
+ * If the NoteList was produced using a text based search + * query that included words that are not indexed or searched by the service, + * this will include a list of those ignored words. + *
+ * + *
searchedWords
+ *
+ * If the NoteList was produced using a text based search + * query that included viable search words or quoted expressions, this will + * include a list of those words. Any stopped words will not be included + * in this list. + *
+ * + *
updateCount
+ *
+ * Indicates the total number of transactions that have + * been committed within the account. This reflects (for example) the + * number of discrete additions or modifications that have been made to + * the data in this account (tags, notes, resources, etc.). + * This number is the "high water mark" for Update Sequence Numbers (USN) + * within the account. + *
+ * + *
searchContextBytes
+ *
+ * Specifies the correlating information about the current search session, in byte array. + *
+ *
+ * + *
debugInfo
+ *
+ * Depends on the value of context in NoteFilter, this field + * may contain debug information if the service decides to do so. + *
+ * + */ +struct NoteList { + 1: required i32 startIndex, + 2: required i32 totalNotes, + 3: required list notes, + 4: optional list stoppedWords, + 5: optional list searchedWords, + 6: optional i32 updateCount, + 7: optional binary searchContextBytes, + 8: optional string debugInfo +} + +/** + * This structure is used in the set of results returned by the + * findNotesMetadata function. It represents the high-level information about + * a single Note, without some of the larger deep structure. This allows + * for the information about a list of Notes to be returned relatively quickly + * with less marshalling and data transfer to remote clients. + * Most fields in this structure are identical to the corresponding field in + * the Note structure, with the exception of: + * + *
+ *
largestResourceMime
+ *
If set, then this will contain the MIME type of the largest Resource + * (in bytes) within the Note. This may be useful, for example, to choose + * an appropriate icon or thumbnail to represent the Note. + *
+ * + *
largestResourceSize
+ *
If set, this will contain the size of the largest Resource file, in + * bytes, within the Note. This may be useful, for example, to decide whether + * to ask the server for a thumbnail to represent the Note. + *
+ *
+ */ +struct NoteMetadata { + 1: required Types.Guid guid, + 2: optional string title, + 5: optional i32 contentLength, + 6: optional Types.Timestamp created, + 7: optional Types.Timestamp updated, + 8: optional Types.Timestamp deleted, + 10: optional i32 updateSequenceNum, + 11: optional string notebookGuid, + 12: optional list tagGuids, + 14: optional Types.NoteAttributes attributes, + 20: optional string largestResourceMime, + 21: optional i32 largestResourceSize +} + +/** + * This structure is returned from calls to the findNotesMetadata function to + * give the high-level metadata about a subset of Notes that are found to + * match a specified NoteFilter in a search. + * + *
+ *
startIndex
+ *
+ * The starting index within the overall set of notes. This + * is also the number of notes that are "before" this list in the set. + *
+ * + *
totalNotes
+ *
+ * The number of notes in the larger set. This can be used + * to calculate how many notes are "after" this note in the set. + * (I.e. remaining = totalNotes - (startIndex + notes.length) ) + *
+ * + *
notes
+ *
+ * The list of metadata for Notes in this range. The set of optional fields + * that are set in each metadata structure will depend on the + * NotesMetadataResultSpec provided by the caller when the search was + * performed. Only the 'guid' field will be guaranteed to be set in each + * Note. + *
+ * + *
stoppedWords
+ *
+ * If the NoteList was produced using a text based search + * query that included words that are not indexed or searched by the service, + * this will include a list of those ignored words. + *
+ * + *
searchedWords
+ *
+ * If the NoteList was produced using a text based search + * query that included viable search words or quoted expressions, this will + * include a list of those words. Any stopped words will not be included + * in this list. + *
+ * + *
updateCount
+ *
+ * Indicates the total number of transactions that have + * been committed within the account. This reflects (for example) the + * number of discrete additions or modifications that have been made to + * the data in this account (tags, notes, resources, etc.). + * This number is the "high water mark" for Update Sequence Numbers (USN) + * within the account. + *
+ * + *
searchContextBytes
+ *
+ * Specifies the correlating information about the current search session, in byte array. + *
+ * + *
debugInfo
+ *
+ * Depends on the value of context in NoteFilter, this field + * may contain debug information if the service decides to do so. + *
+ * + *
+ */ +struct NotesMetadataList { + 1: required i32 startIndex, + 2: required i32 totalNotes, + 3: required list notes, + 4: optional list stoppedWords, + 5: optional list searchedWords, + 6: optional i32 updateCount, + 7: optional binary searchContextBytes, + 9: optional string debugInfo +} + +/** + * This structure is provided to the findNotesMetadata function to specify + * the subset of fields that should be included in each NoteMetadata element + * that is returned in the NotesMetadataList. + * Each field on this structure is a boolean flag that indicates whether the + * corresponding field should be included in the NoteMetadata structure when + * it is returned. For example, if the 'includeTitle' field is set on this + * structure when calling findNotesMetadata, then each NoteMetadata in the + * list should have its 'title' field set. + * If one of the fields in this spec is not set, then it will be treated as + * 'false' by the server, so the default behavior is to include nothing in + * replies (but the mandatory GUID) + */ +struct NotesMetadataResultSpec { + 2: optional bool includeTitle, + 5: optional bool includeContentLength, + 6: optional bool includeCreated, + 7: optional bool includeUpdated, + 8: optional bool includeDeleted, + 10: optional bool includeUpdateSequenceNum, + 11: optional bool includeNotebookGuid, + 12: optional bool includeTagGuids, + 14: optional bool includeAttributes, + 20: optional bool includeLargestResourceMime, + 21: optional bool includeLargestResourceSize +} + +/** + * A data structure representing the number of notes for each notebook + * and tag with a non-zero set of applicable notes. + * + *
+ *
notebookCounts
+ *
+ * A mapping from the Notebook GUID to the number of + * notes (from some selection) that are in the corresponding notebook. + *
+ * + *
tagCounts
+ *
+ * A mapping from the Tag GUID to the number of notes (from some + * selection) that have the corresponding tag. + *
+ * + *
trashCount
+ *
+ * If this is set, then this is the number of notes that are in the trash. + * If this is not set, then the number of notes in the trash hasn't been + * reported. (I.e. if there are no notes in the trash, this will be set + * to 0.) + *
+ *
+ */ +struct NoteCollectionCounts { + 1: optional map notebookCounts, + 2: optional map tagCounts, + 3: optional i32 trashCount +} + +/** + * This structure is provided to the getNoteWithResultSpec function to specify the subset of + * fields that should be included in the Note that is returned. This allows clients to request + * the minimum set of information that they require when retrieving a note, reducing the size + * of the response and improving the response time. + * + * If one of the fields in this spec is not set, then it will be treated as 'false' by the service, + * so that the default behavior is to include none of the fields below in the Note. + * + *
+ *
includeContent
+ *
If true, the Note.content field will be populated with the note's ENML contents.
+ * + *
includeResourcesData
+ *
If true, any Resource elements will include the binary contents of their 'data' field's + * body.
+ * + *
includeResourcesRecognition
+ *
If true, any Resource elements will include the binary contents of their 'recognition' + * field's body if recognition data is available.
+ * + *
includeResourcesAlternateData
+ *
If true, any Resource elements will include the binary contents of their 'alternateData' + * field's body, if an alternate form is available.
+ * + *
includeSharedNotes
+ *
If true, the Note.sharedNotes field will be populated with the note's shares.
+ * + *
includeNoteAppDataValues
+ *
If true, the Note.attributes.applicationData.fullMap field will be populated.
+ * + *
includeResourceAppDataValues
+ *
If true, the Note.resource.attributes.applicationData.fullMap field will be populated.
+ * + *
includeAccountLimits
+ *
If true, the Note.limits field will be populated with the note owner's account limits.
+ *
+ */ +struct NoteResultSpec { + 1: optional bool includeContent, + 2: optional bool includeResourcesData, + 3: optional bool includeResourcesRecognition, + 4: optional bool includeResourcesAlternateData, + 5: optional bool includeSharedNotes, + 6: optional bool includeNoteAppDataValues, + 7: optional bool includeResourceAppDataValues, + 8: optional bool includeAccountLimits +} + +/** + * Parameters that must be given to the NoteStore emailNote call. These allow + * the caller to specify the note to send, the recipient addresses, etc. + * + *
+ *
guid
+ *
+ * If set, this must be the GUID of a note within the user's account that + * should be retrieved from the service and sent as email. If not set, + * the 'note' field must be provided instead. + *
+ * + *
note
+ *
+ * If the 'guid' field is not set, this field must be provided, including + * the full contents of the note note (and all of its Resources) to send. + * This can be used for a Note that as not been created in the service, + * for example by a local client with local notes. + *
+ * + *
toAddresses
+ *
+ * If provided, this should contain a list of the SMTP email addresses + * that should be included in the "To:" line of the email. + * Callers must specify at least one "to" or "cc" email address. + *
+ * + *
ccAddresses
+ *
+ * If provided, this should contain a list of the SMTP email addresses + * that should be included in the "Cc:" line of the email. + * Callers must specify at least one "to" or "cc" email address. + *
+ * + *
subject
+ *
+ * If provided, this should contain the subject line of the email that + * will be sent. If not provided, the title of the note will be used + * as the subject of the email. + *
+ * + *
message
+ *
+ * If provided, this is additional personal text that should be included + * into the email as a message from the owner to the recipient(s). + *
+ *
+ */ +struct NoteEmailParameters { + 1: optional string guid, + 2: optional Types.Note note, + 3: optional list toAddresses, + 4: optional list ccAddresses, + 5: optional string subject, + 6: optional string message +} + +/** + * Identifying information about previous versions of a note that are backed up + * within Evernote's servers. Used in the return value of the listNoteVersions + * call. + * + *
+ *
updateSequenceNum
+ *
+ * The update sequence number for the Note when it last had this content. + * This serves to uniquely identify each version of the note, since USN + * values are unique within an account for each update. + *
+ *
updated
+ *
+ * The 'updated' time that was set on the Note when it had this version + * of the content. This is the user-modifiable modification time on the + * note, so it's not reliable for guaranteeing the order of various + * versions. (E.g. if someone modifies the note, then changes this time + * manually into the past and then updates the note again.) + *
+ *
saved
+ *
+ * A timestamp that holds the date and time when this version of the note + * was backed up by Evernote's servers. + *
+ *
title
+ *
+ * The title of the note when this particular version was saved. (The + * current title of the note may differ from this value.) + *
+ *
lastEditorId
+ *
+ * The ID of the user who made the change to this version of the note. This will be + * unset if the note version was edited by the owner of the account. + *
+ *
+ */ +struct NoteVersionId { + 1: required i32 updateSequenceNum, + 2: required Types.Timestamp updated, + 3: required Types.Timestamp saved, + 4: required string title, + 5: optional Types.UserID lastEditorId +} + +/** + * A description of the thing for which we are searching for related + * entities. + * + * You must specify either noteGuid or plainText, but + * not both. filter and referenceUri are optional. + * + *
+ *
noteGuid
+ *
The GUID of an existing note in your account for which related + * entities will be found.
+ * + *
plainText
+ *
A string of plain text for which to find related entities. + * You should provide a text block with a number of characters between + * EDAM_RELATED_PLAINTEXT_LEN_MIN and EDAM_RELATED_PLAINTEXT_LEN_MAX. + *
+ * + *
filter
+ *
The list of criteria that will constrain the notes being considered + * related. + * Please note that some of the parameters may be ignored, such as + * order and ascending. + *
+ * + *
referenceUri
+ *
A URI string specifying a reference entity, around which "relatedness" + * should be based. This can be an URL pointing to a web page, for example. + *
+ * + *
context
+ *
Specifies the context to consider when determining related results. + * Clients must leave this value unset unless they wish to explicitly specify a known + * non-default context. + *
+ * + *
cacheKey
+ *
If set and non-empty, this is an indicator for the server whether it is actually + * necessary to perform a new findRelated call at all. Cache Keys are opaque strings + * which are returned by the server as part of "RelatedResult" in response + * to a "NoteStore.findRelated" query. Cache Keys are inherently query specific. + * + * If set to an empty string, this indicates that the server should generate a cache + * key in the response as part of "RelatedResult". + * + * If not set, the server will not attempt to generate a cache key at all. + *
+ *
+ */ +struct RelatedQuery { + 1: optional string noteGuid, + 2: optional string plainText, + 3: optional NoteFilter filter, + 4: optional string referenceUri, + 5: optional string context, + 6: optional string cacheKey +} + +/** + * The result of calling findRelated(). The contents of the notes, + * notebooks, and tags fields will be in decreasing order of expected + * relevance. It is possible that fewer results than requested will be + * returned even if there are enough distinct entities in the account + * in cases where the relevance is estimated to be low. + * + *
+ *
notes
+ *
If notes have been requested to be included, this will be the + * list of notes.
+ * + *
notebooks
+ *
If notebooks have been requested to be included, this will be the + * list of notebooks.
+ * + *
tags
+ *
If tags have been requested to be included, this will be the list + * of tags.
+ * + *
containingNotebooks
+ *
If includeContainingNotebooks is set to true + * in the RelatedResultSpec, return the list of notebooks to + * to which the returned related notes belong. The notebooks in this + * list will occur once per notebook GUID and are represented as + * NotebookDescriptor objects.
+ * + *
experts
+ *
If experts have been requested to be included, this will return + * a list of users within your business who have knowledge about the specified query. + *
+ * + *
relatedContent
+ *
If related content has been requested to be included, this will be the list of + * related content snippets. + *
+ * + *
cacheKey
+ *
If set and non-empty, this cache key may be used in subsequent + * "NoteStore.findRelated" calls (via "RelatedQuery") to re-use previous + * responses that were cached on the client-side, instead of actually performing + * another search. + * + * If set to an empty string, this indicates that the server could not determine + * a specific key for this response, but the client should nevertheless remove + * any previously cached result for this request. + * + * If unset/null, it is up to the client whether to re-use cached results or to + * use the server's response. + * + * If set to the exact non-empty cache key that was specified in + * "RelatedQuery.cacheKey", this indicates that the server decided that cached results + * could be reused. + * + * Depending on the cache key specified in the query, the "RelatedResult" may only be + * partially filled. For each set field, the client should replace the corresponding + * part in the previously cached result with the new partial result. + * + * For example, for a specific query that has both "RelatedResultSpec.maxNotes" and + * "RelatedResultSpec.maxRelatedContent" set to positive values, the server may decide + * that the previously requested and cached Related Content are unchanged, + * but new results for Related Notes are available. The + * response will have a new cache key and have "RelatedResult.notes" set, but have + * "RelatedResult.relatedContent" unset (not just empty, but really unset). + * + * In this situation, the client should replace any cached notes with the newly + * returned "RelatedResult.notes", but it can re-use the previously cached entries for + * "RelatedResult.relatedContent". List fields that are set, but empty indicate that + * no results could be found; the cache should be updated correspondingly. + *
+ * + *
cacheExpires
+ *
If set, clients should reuse this response for any situations where the same input + * parameters are applicable for up to this many seconds after receiving this result. + * + * After this time has passed, the client may request a new result from the service, + * but it should supply the stored cacheKey to the service when checking for an + * update. + *
+ * + *
+ */ +struct RelatedResult { + 1: optional list notes, + 2: optional list notebooks, + 3: optional list tags, + 4: optional list containingNotebooks, + 5: optional string debugInfo, + 6: optional list experts, + 7: optional list relatedContent, + 8: optional string cacheKey, + 9: optional i32 cacheExpires +} + +/** + * A description of the thing for which the service will find related + * entities, via findRelated(), together with a description of what + * type of entities and how many you are seeking in the + * RelatedResult. + * + *
+ *
maxNotes
+ *
Return notes that are related to the query, but no more than + * this many. Any value greater than EDAM_RELATED_MAX_NOTES + * will be silently capped. If you do not set this field, then + * no notes will be returned.
+ * + *
maxNotebooks
+ *
Return notebooks that are related to the query, but no more than + * this many. Any value greater than EDAM_RELATED_MAX_NOTEBOOKS + * will be silently capped. If you do not set this field, then + * no notebooks will be returned.
+ * + *
maxTags
+ *
Return tags that are related to the query, but no more than + * this many. Any value greater than EDAM_RELATED_MAX_TAGS + * will be silently capped. If you do not set this field, then + * no tags will be returned.
+ *
+ * + *
writableNotebooksOnly
+ *
Require that all returned related notebooks are writable. + * The user will be able to create notes in all returned notebooks. + * However, individual notes returned may still belong to notebooks + * in which the user lacks the ability to create notes.
+ *
+ * + *
includeContainingNotebooks
+ *
If set to true, return the containingNotebooks field + * in the RelatedResult, which will contain the list of notebooks to + * to which the returned related notes belong.
+ * + * + *
includeDebugInfo
+ *
If set to true, indicate that debug information should + * be returned in the 'debugInfo' field of RelatedResult. Note that the call may + * be slower if this flag is set.
+ * + *
maxExperts
+ *
This can only be used when making a findRelated call against a business. + * Find users within your business who have knowledge about the specified query. + * No more than this many users will be returned. Any value greater than + * EDAM_RELATED_MAX_EXPERTS will be silently capped. + *
+ * + *
maxRelatedContent
+ *
Return snippets of related content that is related to the query, but no more than + * this many. Any value greater than EDAM_RELATED_MAX_RELATED_CONTENT will be silently + * capped. If you do not set this field, then no related content will be returned.
+ * + * + *
relatedContentTypes
+ *
Specifies the types of Related Content that should be returned.
+ * + */ +struct RelatedResultSpec { + 1: optional i32 maxNotes, + 2: optional i32 maxNotebooks, + 3: optional i32 maxTags, + 4: optional bool writableNotebooksOnly, + 5: optional bool includeContainingNotebooks, + 6: optional bool includeDebugInfo, + 7: optional i32 maxExperts, + 8: optional i32 maxRelatedContent, + 9: optional set relatedContentTypes, +} + +/** + * The result of a call to updateNoteIfUsnMatches, which optionally updates a note + * based on the current value of the note's update sequence number on the service. + * + *
+ *
note
+ *
Either the current state of the note if updated is false or the + * result of updating the note as would be done via the updateNote method. + * If the note was not updated, you will receive a Note that does not include note + * content, resources data, resources recognition data, or resources alternate data. + * You can check for updates to these large objects by checking the Data.bodyHash + * values and downloading accordingly.
+ * + *
updated
+ *
Whether or not the note was updated by the operation.
+ *
+ */ +struct UpdateNoteIfUsnMatchesResult { + 1: optional Types.Note note, + 2: optional bool updated +} + +/* + * This structure is used by the service to communicate to clients, via + * getShareRelationships, which privilege levels are assignable to the + * target of a share relationship. + * + *
+ *
noSetReadOnly
+ *
This value is true if the user is not allowed to set the privilege + * level to READ_ONLY.
+ * + *
noSetReadPlusActivity
+ *
This value is true if the user is not allowed to set the privilege + * level to READ_NOTEBOOK_PLUS_ACTIVITY.
+ * + *
noSetModify
+ *
This value is true if the user is not allowed to set the + * privilege level to MODIFY_NOTEBOOK_PLUS_ACTIVITY.
+ * + *
noSetFullAccess
+ *
This value is true if the user is not allowed to set the + * privilege level to FULL_ACCESS, or BUSINESS_FULL_ACCESS if the + * notebook is a business notebook
+ *
+ */ +struct ShareRelationshipRestrictions { + 1: optional bool noSetReadOnly, + 2: optional bool noSetReadPlusActivity, + 3: optional bool noSetModify, + 4: optional bool noSetFullAccess +} + +/** + * Privilege levels for accessing shared notebooks. + * + * READ_NOTEBOOK: Recipient is able to read the contents of the shared notebook + * but does not have access to information about other recipients of the + * notebook or the activity stream information. + * + * READ_NOTEBOOK_PLUS_ACTIVITY: Recipient has READ_NOTEBOOK rights and can also + * access information about other recipients and the activity stream. + * + * MODIFY_NOTEBOOK_PLUS_ACTIVITY: Recipient has rights to read and modify the contents + * of the shared notebook, including the right to move notes to the trash and to create + * notes in the notebook. The recipient can also access information about other + * recipients and the activity stream. + * + * FULL_ACCESS: Recipient has full rights to the shared notebook and recipient lists, + * including privilege to revoke and create invitations and to change privilege + * levels on invitations for individuals. If the user is a member of the same group, + * (e.g. the same business) as the shared notebook, they will additionally be granted + * permissions to update the publishing status of the notebook. + */ +enum ShareRelationshipPrivilegeLevel { + READ_NOTEBOOK = 0, + READ_NOTEBOOK_PLUS_ACTIVITY = 10, + MODIFY_NOTEBOOK_PLUS_ACTIVITY = 20, + FULL_ACCESS = 30, +} + +/** + * Describes an invitation to a person to use their Evernote + * credentials to become a member of a notebook. + * + *
+ *
displayName
+ *
The string that clients should show to users to represent this + * invitation.
+ * + *
recipientUserIdentity
+ *
Identifies the recipient of the invitation. The user identity + * type can be either EMAIL, EVERNOTE or IDENTITYID. If the + * invitation was created using the classic notebook sharing APIs it will be EMAIL. If it + * was created using the new identity-based notebook sharing APIs it will either be + * EVERNOTE or IDENTITYID, depending on whether we can map the identity to an Evernote + * user at the time of creation. + *
+ * + *
privilege
+ *
The privilege level at which the member will be joined, if it + * turns out that the member is not already joined at a higher level. + * Note that the identity field may not uniquely identify an + * Evernote User ID, and so we won't know until the invitation is + * redeemed whether or not the recipient already has privilege.
+ * + *
sharerUserId
+ *
The user id of the user who most recently shared this notebook + * to this identity. This field is used by the service to convey information + * to the user, so clients should treat it as read-only.
+ *
+ */ +struct InvitationShareRelationship { + 1: optional string displayName, + 2: optional Types.UserIdentity recipientUserIdentity, + 3: optional ShareRelationshipPrivilegeLevel privilege, + 5: optional Types.UserID sharerUserId +} + +/** + * Describes the association between a Notebook and an Evernote User who is + * a member of that notebook. + * + *
+ *
displayName
+ *
The string that clients should show to users to represent this + * member.
+ * + *
recipientUserId
+ *
The Evernote User ID of the recipient of this notebook share. + *
+ * + *
bestPrivilege
+ *
The privilege at which the member can access the notebook, + * which is the best privilege granted either individually or to a + * group to which a member belongs, such as a business. This field is + * used by the service to convey information to the user, so clients + * should treat it as read-only.
+ * + *
individualPrivilege
+ *
The individually granted privilege for the member, which does + * not take GROUP privileges into account. This value may be unset if + * only a group-assigned privilege has been granted to the member. + * This value can be managed by others with sufficient rights using + * the manageNotebookShares method. The valid values that clients + * should present to users for selection are given via the the + * 'restrictions' field.
+ * + *
restrictions
+ *
The restrictions on which privileges may be individually + * assigned to the recipient of this share relationship.
+ * + *
sharerUserId
+ *
The user id of the user who most recently shared the notebook + * to this user. This field is currently unset for a MemberShareRelationship + * created by joining a notebook that has been published to the business + * (MemberShareRelationships where the individual privilege is unset). + * This field is used by the service to convey information to the user, so + * clients should treat it as read-only. + *
+ *
+ */ +struct MemberShareRelationship { + 1: optional string displayName, + 2: optional Types.UserID recipientUserId, + 3: optional ShareRelationshipPrivilegeLevel bestPrivilege, + 4: optional ShareRelationshipPrivilegeLevel individualPrivilege, + 5: optional ShareRelationshipRestrictions restrictions, + 6: optional Types.UserID sharerUserId +} + +/** + * Captures a collection of share relationships for a notebook, for + * example, as returned by the getNotebookShares method. The share + * relationships fall into two broad categories: members, and + * invitations that can be used to become members. + * + *
+ *
invitations
+ *
A list of open invitations that can be redeemed into + * memberships to the notebook.
+ * + *
memberships
+ *
A list of memberships of the notebook. A member is identified + * by their Evernote UserID and has rights to access the + * notebook.
+ * + *
invitationRestrictions
+ *
The restrictions on what privileges may be granted to invitees + * to this notebook. These restrictions may be specific to the calling + * user or to the notebook itself. They represent the + * union of all possible invite cases, so it is possible that once the + * recipient of the invitation has been identified by the service, such + * as by a business auto-join, the actual assigned privilege may change. + *
+ *
+ */ +struct ShareRelationships { + 1: optional list invitations, + 2: optional list memberships, + 3: optional ShareRelationshipRestrictions invitationRestrictions +} + +/** + * A structure that captures parameters used by clients to manage the + * shares for a given notebook via the manageNotebookShares method. + * + *
+ *
notebookGuid
+ *
The GUID of the notebook whose shares are being managed.
+ * + *
inviteMessage
+ *
If the service sends a message to invitees, this parameter will + * be used to form the actual message that is sent.
+ * + *
membershipsToUpdate
+ *
The list of existing memberships to update. This field is not + * intended to be the full set of memberships for the notebook and + * should only include those already-existing memberships that you + * actually want to change. If you want to remove shares, see the + * unshares fields. If you want to create a membership, + * i.e. auto-join a business user, you can do this via the + * invitationsToCreateOrUpdate field using an Evernote UserID of a + * fellow business member (the created invitation is automatically + * joined by the service, so the client is creating an + * invitation, not a membership).
+ * + *
invitationsToCreateOrUpdate
+ *
The list of invitations to update, as matched by the identity + * field of the InvitationShareRelationship instances, or to create if + * an existing invitation does not exist. This field is not intended + * to be the full set of invitations on the notebook and should only + * include those invitations that you wish to create or update. Note + * that your invitation could convert into a membership via a + * service-supported auto-join operation. This happens, for example, + * when you use an invitation with an Evernote UserID type for a + * recipient who is a member of the business to which the notebook + * belongs. Note that to discover the user IDs for business members, + * the sharer must also be part of the business.
+ * + *
unshares
+ *
The list of share relationships to expunge from the service. + * If the user identity is for an Evernote UserID, then matching invitations or + * memberships will be removed. If it's an e-mail, then e-mail based shared notebook + * invitations will be removed. If it's for an Identity ID, then any invitations that + * match the identity (by identity ID or user ID or e-mail for legacy invitations) will be + * removed.
+ *
+ */ +struct ManageNotebookSharesParameters { + 1: optional string notebookGuid, + 2: optional string inviteMessage, + 3: optional list membershipsToUpdate, + 4: optional list invitationsToCreateOrUpdate, + 5: optional list unshares +} + +/** + * A structure to capture certain errors that occurred during a call + * to manageNotebookShares. That method can be run best-effort, + * meaning that some change requests can be applied while others fail. + * Note that some errors such as system errors will still fail the + * entire transaction regardless of running best effort. When some + * change requests do not succeed, the error conditions are captured + * in instances of this class, captured by the identity of the share + * relationship and one of the exception fields. + * + *
+ *
userIdentity
+ *
The identity of the share relationship whose update encountered + * an error.
+ * + *
userException
+ *
If the error is represented as an EDAMUserException that would + * have otherwise been thrown without best-effort execution. Only one + * exception field will be set.
+ * + *
notFoundException
+ *
If the error is represented as an EDAMNotFoundException that would + * have otherwise been thrown without best-effort execution. Only one + * exception field will be set.
+ *
+ */ +struct ManageNotebookSharesError { + 1: optional Types.UserIdentity userIdentity, + 2: optional Errors.EDAMUserException userException, + 3: optional Errors.EDAMNotFoundException notFoundException +} + +/** + * The return value of a call to the manageNotebookShares method. + * + *
+ *
errors
+ *
If the method completed without throwing exceptions, some errors + * might still have occurred, and in that case, this field will contain + * the list of those errors the occurred. + *
+ *
+ */ +struct ManageNotebookSharesResult { + 1: optional list errors +} + +/** + * A structure used to share a note with one or more recipients at a given privilege. + * + *
+ *
noteGuid
+ *
The GUID of the note.
+ * + *
recipientThreadId
+ *
The recipients of the note share specified as a messaging thread ID. If you + * have an existing messaging thread to share the note with, specify its ID + * here instead of recipientContacts in order to properly support defunct + * identities. The sharer must be a participant of the thread. Either this + * field or recipientContacts must be set.
+ * + *
recipientContacts
+ *
The recipients of the note share specified as a list of contacts. This should + * only be set if the sharing takes place before the thread is created. Use + * recipientThreadId instead when sharing with an existing thread. Either this + * field or recipientThreadId must be set.
+ * + *
privilege
+ *
The privilege level to be granted.
+ *
+ */ +struct SharedNoteTemplate { + 1: optional Types.Guid noteGuid, + 4: optional Types.MessageThreadID recipientThreadId, + 2: optional list recipientContacts, + 3: optional Types.SharedNotePrivilegeLevel privilege +} + +/** + * A structure used to share a notebook with one or more recipients at a given privilege. + * + *
+ *
notebookGuid
+ *
The GUID of the notebook.
+ * + *
recipientThreadId
+ *
The recipients of the notebook share specified as a messaging thread ID. If you + * have an existing messaging thread to share the note with, specify its ID + * here instead of recipientContacts in order to properly support defunct + * identities. The sharer must be a participant of the thread. Either this field + * or recipientContacts must be set.
+ * + *
recipientContacts
+ *
The recipients of the notebook share specified as a list of contacts. This should + * only be set if the sharing takes place before the thread is created. Use + * recipientThreadId instead when sharing with an existing thread. Either this + * field or recipientThreadId must be set.
+ * + *
privilege
+ *
The privilege level to be granted.
+ *
+ */ +struct NotebookShareTemplate { + 1: optional Types.Guid notebookGuid, + 4: optional Types.MessageThreadID recipientThreadId, + 2: optional list recipientContacts, + 3: optional Types.SharedNotebookPrivilegeLevel privilege +} + +/** + * A structure containing the results of a call to createOrUpdateNotebookShares. + * + *
+ *
updateSequenceNum
+ *
The USN of the notebook after the call.
+ * + *
matchingShares
+ *
A list of SharedNotebook records that match the desired recipients. These + * records may have been either created or updated by the call to + * createOrUpdateNotebookShares, or they may have been at the desired privilege + * privilege level prior to the call.
+ *
+ */ +struct CreateOrUpdateNotebookSharesResult { + 1: optional i32 updateSequenceNum, + 2: optional list matchingShares +} + +/** + * This structure is used by the service to communicate to clients, via + * getNoteShareRelationships, which privilege levels are assignable to the + * target of a note share relationship. + * + *
+ *
noSetReadNote
+ *
This value is true if the user is not allowed to set the privilege + * level to SharedNotePrivilegeLevel.READ_NOTE.
+ * + *
noSetModifyNote
+ *
This value is true if the user is not allowed to set the privilege + * level to SharedNotePrivilegeLevel.MODIFY_NOTE.
+ * + *
noSetFullAccess
+ *
This value is true if the user is not allowed to set the + * privilege level to SharedNotePrivilegeLevel.FULL_ACCESS.
+ *
+ */ +struct NoteShareRelationshipRestrictions { + 1: optional bool noSetReadNote, + 2: optional bool noSetModifyNote, + 3: optional bool noSetFullAccess +} + +/** + * Describes the association between a Note and an Evernote User who is + * a member of that note. + * + *
+ *
displayName
+ *
The string that clients should show to users to represent this + * member.
+ * + *
recipientUserId
+ *
The Evernote UserID of the user who is a member to the note.
+ * + *
privilege
+ *
The privilege at which the member can access the note, + * which is the best privilege granted to the user across all of their + * individual shares for this note. This field is used by the service + * to convey information to the user, so clients should treat it as + * read-only.
+ * + *
restrictions
+ *
The restrictions on which privileges may be individually + * assigned to the recipient of this share relationship. This field + * is used by the service to convey information to the user, so + * clients should treat it as read-only.
+ * + *
sharerUserId
+ *
The user id of the user who most recently shared the note with + * this user. This field is used by the service to convey information + * to the user, so clients should treat it as read-only.
+ *
+ */ +struct NoteMemberShareRelationship { + 1: optional string displayName, + 2: optional Types.UserID recipientUserId, + 3: optional Types.SharedNotePrivilegeLevel privilege, + 4: optional NoteShareRelationshipRestrictions restrictions, + 5: optional Types.UserID sharerUserId +} + +/** + * Describes an invitation to a person to use their Evernote credentials + * to gain access to a note belonging to another user. + * + *
+ *
displayName
+ *
The string that clients should show to users to represent this + * invitation.
+ * + *
recipientIdentityId
+ *
Identifies the identity of the invitation recipient. Once the + * identity has been claimed by an Evernote user and they have accessed + * the note at least once, the invitation will be used up and will no + * longer be returned by the service to clients. Instead, that recipient + * will be included in the list of NoteMemberShareRelationships.
+ * + *
privilege
+ *
The privilege level that the recipient will be granted when they + * accept this invitation. If the user already has a higher privilege to + * access this note then this will not affect the recipient's privileges.
+ * + *
sharerUserId
+ *
The user id of the user who most recently shared this note to this + * recipient. This field is used by the service to convey information + * to the user, so clients should treat it as read-only.
+ */ +struct NoteInvitationShareRelationship { + 1: optional string displayName, + 2: optional Types.IdentityID recipientIdentityId, + 3: optional Types.SharedNotePrivilegeLevel privilege, + 5: optional Types.UserID sharerUserId +} + +/** + * Captures a collection of share relationships for a single note, + * for example, as returned by the getNoteShares method. The share + * relationships fall into two broad categories: members, and + * invitations that can be used to become members. + * + *
+ *
invitations
+ *
A list of open invitations that can be redeemed into + * memberships to the note.
+ * + *
memberships
+ *
A list of memberships of the noteb. A member is identified + * by their Evernote UserID and has rights to access the + * note.
+ * + *
restrictions
+ *
The restrictions on which privileges may be assigned to the recipient + * of an open invitation. These restrictions only apply to invitations; + * restrictions on memberships are specified on the NoteMemberShareRelationship. + * This field is used by the service to convey information to the user, so + * clients should treat it as read-only.
+ * + *
+ */ +struct NoteShareRelationships { + 1: optional list invitations, + 2: optional list memberships, + 3: optional NoteShareRelationshipRestrictions invitationRestrictions +} + +/** + * Captures parameters used by clients to manage the shares for a given + * note via the manageNoteShares function. This is used only to manage + * the existing memberships and invitations for a note. To invite a new + * recipient, use NoteStore.createOrUpdateSharedNotes. + * + * The only field of an existing membership or invitation that can be + * updated by this function is the share privilege. + * + *
+ *
noteGuid
+ *
The GUID of the note whose shares are being managed.
+ * + *
membershipsToUpdate
+ *
A list of existing memberships to update. This field is not + * meant to be the full set of memberships for the note. Clients + * should only include those existing memberships that they wish + * to modify. To remove an existing membership, see the unshares + * field.
+ * + *
invitationsToUpdate
+ *
The list of outstanding invitations to update, as matched by the + * identity field of the NoteInvitationShareRelatioship instances. + * This field is not meant to be the full set of invitations for the + * note. Clients should only include those existing invitations that + * they wish to modify.
+ * + *
membershipsToUnshare
+ *
A list of existing memberships to expunge from the service.
+ * + *
invitationsToUnshare
+ *
A list of outstanding invitations to expunge from the service.
+ *
+ */ +struct ManageNoteSharesParameters { + 1: optional string noteGuid, + 2: optional list membershipsToUpdate, + 3: optional list invitationsToUpdate, + 4: optional list membershipsToUnshare + 5: optional list invitationsToUnshare +} + +/** + * Captures errors that occur during a call to manageNoteShares. That + * function can be run best-effort, meaning that some change requests can + * be applied while others fail. Note that some errors such as system + * exceptions may still cause the entire call to fail. + * + * Only one of the two ID fields will be set on a given error. + * + * Only one of the two exception fields will be set on a given error. + * + *
+ *
identityID
+ *
The identity ID of an outstanding invitation that was not updated + * due to the error.
+ * + *
userID
+ *
The user ID of an existing membership that was not updated due + * to the error.
+ * + *
userException
+ *
If the error is represented as an EDAMUserException that would + * have otherwise been thrown without best-effort execution.
+ * + *
notFoundException
+ *
If the error is represented as an EDAMNotFoundException that + * would have otherwise been thrown without best-effort execution. + * The identifier field of the exception will be either "Identity.id" + * or "User.id", indicating that no existing share could be found for + * the specified recipient.
+ *
+ */ +struct ManageNoteSharesError { + 1: optional Types.IdentityID identityID, + 2: optional Types.UserID userID, + 3: optional Errors.EDAMUserException userException, + 4: optional Errors.EDAMNotFoundException notFoundException +} + +/** + * The return value of a call to the manageNoteShares function. + * + *
+ *
errors
+ *
If the call succeeded without throwing an exception, some errors + * might still have occurred. In that case, this field will contain the + * list of errors.
+ *
+ */ +struct ManageNoteSharesResult { + 1: optional list errors +} + +/** + * Service: NoteStore + *

+ * The NoteStore service is used by EDAM clients to exchange information + * about the collection of notes in an account. This is primarily used for + * synchronization, but could also be used by a "thin" client without a full + * local cache. + *

+ * Most functions take an "authenticationToken" parameter, which is the + * value returned by the UserStore which permits access to the account. + *

+ * + * Calls which require an authenticationToken may throw an EDAMUserException + * for the following reasons: + *
    + *
  • DATA_REQUIRED "authenticationToken" - token is empty
  • + *
  • BAD_DATA_FORMAT "authenticationToken" - token is malformed
  • + *
  • INVALID_AUTH "authenticationToken" - token signature is invalid
  • + *
  • AUTH_EXPIRED "authenticationToken" - token has expired or been revoked
  • + *
  • PERMISSION_DENIED "authenticationToken" - token does not grant permission + * to perform the requested action
  • + *
  • BUSINESS_SECURITY_LOGIN_REQUIRED "sso" - the user is a member of a business + * that requires single sign-on, and must complete SSO before accessing business + * content. + *
+ */ +service NoteStore { + + /*========== Synchronization functions for caching clients ===========*/ + + /** + * Asks the NoteStore to provide information about the status of the user + * account corresponding to the provided authentication token. + */ + SyncState getSyncState(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Asks the NoteStore to provide the state of the account in order of + * last modification. This request retrieves one block of the server's + * state so that a client can make several small requests against a large + * account rather than getting the entire state in one big message. + * This call gives fine-grained control of the data that will + * be received by a client by omitting data elements that a client doesn't + * need. This may reduce network traffic and sync times. + * + * @param afterUSN + * The client can pass this value to ask only for objects that + * have been updated after a certain point. This allows the client to + * receive updates after its last checkpoint rather than doing a full + * synchronization on every pass. The default value of "0" indicates + * that the client wants to get objects from the start of the account. + * + * @param maxEntries + * The maximum number of modified objects that should be + * returned in the result SyncChunk. This can be used to limit the size + * of each individual message to be friendly for network transfer. + * + * @param filter + * The caller must set some of the flags in this structure to specify which + * data types should be returned during the synchronization. See + * the SyncChunkFilter structure for information on each flag. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "afterUSN" - if negative + *
  • + *
  • BAD_DATA_FORMAT "maxEntries" - if less than 1 + *
  • + *
+ */ + SyncChunk getFilteredSyncChunk(1: string authenticationToken, + 2: i32 afterUSN, + 3: i32 maxEntries, + 4: SyncChunkFilter filter) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Asks the NoteStore to provide information about the status of a linked + * notebook that has been shared with the caller, or that is public to the + * world. + * This will return a result that is similar to getSyncState, but may omit + * SyncState.uploaded if the caller doesn't have permission to write to + * the linked notebook. + * + * This function must be called on the shard that owns the referenced + * notebook. (I.e. the shardId in /shard/shardId/edam/note must be the + * same as LinkedNotebook.shardId.) + * + * @param authenticationToken + * This should be an authenticationToken for the guest who has received + * the invitation to the share. (I.e. this should not be the result of + * NoteStore.authenticateToSharedNotebook) + * + * @param linkedNotebook + * This structure should contain identifying information and permissions + * to access the notebook in question. + * + * @throws EDAMUserException
    + *
  • DATA_REQUIRED "LinkedNotebook.username" - The username field must be + * populated with the current username of the owner of the notebook for which + * you are obtaining sync state. + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "LinkedNotebook.username" - If the LinkedNotebook.username field does not + * correspond to a current user on the service. + *
  • + *
+ * + * @throws SystemException
    + *
  • SHARD_UNAVAILABLE - If the provided LinkedNotebook.username corresponds to a + * user whose account is on a shard other than that on which this method was + * invoked. + *
  • + *
+ */ + SyncState getLinkedNotebookSyncState(1: string authenticationToken, + 2: Types.LinkedNotebook linkedNotebook) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Asks the NoteStore to provide information about the contents of a linked + * notebook that has been shared with the caller, or that is public to the + * world. + * This will return a result that is similar to getSyncChunk, but will only + * contain entries that are visible to the caller. I.e. only that particular + * Notebook will be visible, along with its Notes, and Tags on those Notes. + * + * This function must be called on the shard that owns the referenced + * notebook. (I.e. the shardId in /shard/shardId/edam/note must be the + * same as LinkedNotebook.shardId.) + * + * @param authenticationToken + * This should be an authenticationToken for the guest who has received + * the invitation to the share. (I.e. this should not be the result of + * NoteStore.authenticateToSharedNotebook) + * + * @param linkedNotebook + * This structure should contain identifying information and permissions + * to access the notebook in question. This must contain the valid fields + * for either a shared notebook (e.g. shareKey) + * or a public notebook (e.g. username, uri) + * + * @param afterUSN + * The client can pass this value to ask only for objects that + * have been updated after a certain point. This allows the client to + * receive updates after its last checkpoint rather than doing a full + * synchronization on every pass. The default value of "0" indicates + * that the client wants to get objects from the start of the account. + * + * @param maxEntries + * The maximum number of modified objects that should be + * returned in the result SyncChunk. This can be used to limit the size + * of each individual message to be friendly for network transfer. + * Applications should not request more than 256 objects at a time, + * and must handle the case where the service returns less than the + * requested number of objects in a given request even though more + * objects are available on the service. + * + * @param fullSyncOnly + * If true, then the client only wants initial data for a full sync. + * In this case, the service will not return any expunged objects, + * and will not return any Resources, since these are also provided + * in their corresponding Notes. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "afterUSN" - if negative + *
  • + *
  • BAD_DATA_FORMAT "maxEntries" - if less than 1 + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "LinkedNotebook" - if the provided information doesn't match any + * valid notebook + *
  • + *
  • "LinkedNotebook.uri" - if the provided public URI doesn't match any + * valid notebook + *
  • + *
  • "SharedNotebook.id" - if the provided information indicates a + * shared notebook that no longer exists + *
  • + *
+ */ + SyncChunk getLinkedNotebookSyncChunk(1: string authenticationToken, + 2: Types.LinkedNotebook linkedNotebook, + 3: i32 afterUSN, + 4: i32 maxEntries, + 5: bool fullSyncOnly) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /*============= General account manipulation functions ===============*/ + + /** + * Returns a list of all of the notebooks in the account. + */ + list listNotebooks(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Returns a list of all the notebooks in a business that the user has permission to access, + * regardless of whether the user has joined them. This includes notebooks that have been shared + * with the entire business as well as notebooks that have been shared directly with the user. + * + * @param authenticationToken A business authentication token obtained by calling + * UserStore.authenticateToBusiness. + * + * @throws EDAMUserException
    + *
  • INVALID_AUTH "authenticationToken" - if the authentication token is not a + * business auth token.
  • + *
+ */ + list listAccessibleBusinessNotebooks(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Returns the current state of the notebook with the provided GUID. + * The notebook may be active or deleted (but not expunged). + * + * @param guid + * The GUID of the notebook to be retrieved. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Notebook.guid" - if the parameter is missing + *
  • + *
  • PERMISSION_DENIED "Notebook" - private notebook, user doesn't own + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Notebook.guid" - tag not found, by GUID + *
  • + *
+ */ + Types.Notebook getNotebook(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns the notebook that should be used to store new notes in the + * user's account when no other notebooks are specified. + */ + Types.Notebook getDefaultNotebook(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Asks the service to make a notebook with the provided name. + * + * @param notebook + * The desired fields for the notebook must be provided on this + * object. The name of the notebook must be set, and either the 'active' + * or 'defaultNotebook' fields may be set by the client at creation. + * If a notebook exists in the account with the same name (via + * case-insensitive compare), this will throw an EDAMUserException. + * + * @return + * The newly created Notebook. The server-side GUID will be + * saved in this object's 'guid' field. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Notebook.name" - invalid length or pattern
  • + *
  • BAD_DATA_FORMAT "Notebook.stack" - invalid length or pattern
  • + *
  • BAD_DATA_FORMAT "Publishing.uri" - if publishing set but bad uri
  • + *
  • BAD_DATA_FORMAT "Publishing.publicDescription" - if too long
  • + *
  • DATA_CONFLICT "Notebook.name" - name already in use
  • + *
  • DATA_CONFLICT "Publishing.uri" - if URI already in use
  • + *
  • DATA_REQUIRED "Publishing.uri" - if publishing set but uri missing
  • + *
  • DATA_REQUIRED "Notebook" - notebook parameter was null
  • + *
  • PERMISSION_DENIED "Notebook.defaultNotebook" - if the 'defaultNotebook' field + * is set to 'true' for a Notebook that is not owned by the user identified by + * the passed authenticationToken.
  • + *
  • LIMIT_REACHED "Notebook" - at max number of notebooks
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Workspace.guid" - if workspaceGuid set and no Workspace exists for the GUID + *
  • + *
+ */ + Types.Notebook createNotebook(1: string authenticationToken, + 2: Types.Notebook notebook) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Submits notebook changes to the service. The provided data must include the + * notebook's guid field for identification. + *

+ * The Notebook will be moved to the specified Workspace, if a non empty + * Notebook.workspaceGuid is provided. If an empty Notebook.workspaceGuid is set and the + * Notebook is in a Workspace, then it will be removed from the Workspace and a full + * access SharedNotebook record will be ensured for the caller. If the caller does not + * already have a full access share, either the privilege of an existing share will be + * upgraded or a new share will be created. It is illegal to set a + * Notebook.workspaceGuid on a Workspace backing Notebook. + * + * @param notebook + * The notebook object containing the requested changes. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException

    + *
  • BAD_DATA_FORMAT "Notebook.name" - invalid length or pattern
  • + *
  • BAD_DATA_FORMAT "Notebook.stack" - invalid length or pattern
  • + *
  • BAD_DATA_FORMAT "Publishing.uri" - if publishing set but bad uri
  • + *
  • BAD_DATA_FORMAT "Publishing.publicDescription" - if too long
  • + *
  • DATA_CONFLICT "Notebook.name" - name already in use
  • + *
  • DATA_CONFLICT "Publishing.uri" - if URI already in use
  • + *
  • DATA_REQUIRED "Publishing.uri" - if publishing set but uri missing
  • + *
  • DATA_REQUIRED "Notebook" - notebook parameter was null
  • + *
  • PERMISSION_DENIED "Notebook.defaultNotebook" - if the 'defaultNotebook' field + * is set to 'true' for a Notebook that is not owned by the user identified by + * the passed authenticationToken.
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Notebook.guid" - not found, by GUID
  • + *
  • "Workspace.guid" - if a non empty workspaceGuid set and no Workspace exists + * for the GUID + *
  • + *
+ */ + i32 updateNotebook(1: string authenticationToken, + 2: Types.Notebook notebook) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Permanently removes the notebook from the user's account. + * After this action, the notebook is no longer available for undeletion, etc. + * If the notebook contains any Notes, they will be moved to the current + * default notebook and moved into the trash (i.e. Note.active=false). + *

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

    + *
  • BAD_DATA_FORMAT "Notebook.guid" - if the parameter is missing + *
  • + *
  • LIMIT_REACHED "Notebook" - trying to expunge the last Notebook + *
  • + *
  • PERMISSION_DENIED "Notebook" - private notebook, user doesn't own + *
  • + *
+ */ + i32 expungeNotebook(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns a list of the tags in the account. Evernote does not support + * the undeletion of tags, so this will only include active tags. + */ + list listTags(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Returns a list of the tags that are applied to at least one note within + * the provided notebook. If the notebook is public, the authenticationToken + * may be ignored. + * + * @param notebookGuid + * the GUID of the notebook to use to find tags + * + * @throws EDAMNotFoundException
    + *
  • "Notebook.guid" - notebook not found by GUID + *
  • + *
+ */ + list listTagsByNotebook(1: string authenticationToken, + 2: Types.Guid notebookGuid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns the current state of the Tag with the provided GUID. + * + * @param guid + * The GUID of the tag to be retrieved. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Tag.guid" - if the parameter is missing + *
  • + *
  • PERMISSION_DENIED "Tag" - private Tag, user doesn't own + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Tag.guid" - tag not found, by GUID + *
  • + *
+ */ + Types.Tag getTag(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Asks the service to make a tag with a set of information. + * + * @param tag + * The desired list of fields for the tag are specified in this + * object. The caller must specify the tag name, and may provide + * the parentGUID. + * + * @return + * The newly created Tag. The server-side GUID will be + * saved in this object. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Tag.name" - invalid length or pattern + *
  • + *
  • BAD_DATA_FORMAT "Tag.parentGuid" - malformed GUID + *
  • + *
  • DATA_CONFLICT "Tag.name" - name already in use + *
  • + *
  • LIMIT_REACHED "Tag" - at max number of tags + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Tag.parentGuid" - not found, by GUID + *
  • + *
+ */ + Types.Tag createTag(1: string authenticationToken, + 2: Types.Tag tag) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Submits tag changes to the service. The provided data must include + * the tag's guid field for identification. The service will apply + * updates to the following tag fields: name, parentGuid + * + * @param tag + * The tag object containing the requested changes. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Tag.name" - invalid length or pattern + *
  • + *
  • BAD_DATA_FORMAT "Tag.parentGuid" - malformed GUID + *
  • + *
  • DATA_CONFLICT "Tag.name" - name already in use + *
  • + *
  • DATA_CONFLICT "Tag.parentGuid" - can't set parent: circular + *
  • + *
  • PERMISSION_DENIED "Tag" - user doesn't own tag + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Tag.guid" - tag not found, by GUID + *
  • + *
  • "Tag.parentGuid" - parent not found, by GUID + *
  • + *
+ */ + i32 updateTag(1: string authenticationToken, + 2: Types.Tag tag) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Removes the provided tag from every note that is currently tagged with + * this tag. If this operation is successful, the tag will still be in + * the account, but it will not be tagged on any notes. + * + * This function is not indended for use by full synchronizing clients, since + * it does not provide enough result information to the client to reconcile + * the local state without performing a follow-up sync from the service. This + * is intended for "thin clients" that need to efficiently support this as + * a UI operation. + * + * @param guid + * The GUID of the tag to remove from all notes. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Tag.guid" - if the guid parameter is missing + *
  • + *
  • PERMISSION_DENIED "Tag" - user doesn't own tag + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Tag.guid" - tag not found, by GUID + *
  • + *
+ */ + void untagAll(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Permanently deletes the tag with the provided GUID, if present. + *

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

    + *
  • BAD_DATA_FORMAT "Tag.guid" - if the guid parameter is missing + *
  • + *
  • PERMISSION_DENIED "Tag" - user doesn't own tag + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Tag.guid" - tag not found, by GUID + *
  • + *
+ */ + i32 expungeTag(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + + /** + * Returns a list of the searches in the account. Evernote does not support + * the undeletion of searches, so this will only include active searches. + */ + list listSearches(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Returns the current state of the search with the provided GUID. + * + * @param guid + * The GUID of the search to be retrieved. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "SavedSearch.guid" - if the parameter is missing + *
  • + *
  • PERMISSION_DENIED "SavedSearch" - private Tag, user doesn't own + *
  • + * + * @throws EDAMNotFoundException
      + *
    • "SavedSearch.guid" - not found, by GUID + *
    • + *
    + */ + Types.SavedSearch getSearch(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Asks the service to make a saved search with a set of information. + * + * @param search + * The desired list of fields for the search are specified in this + * object. The caller must specify the name and query for the + * search, and may optionally specify a search scope. + * The SavedSearch.format field is ignored by the service. + * + * @return + * The newly created SavedSearch. The server-side GUID will be + * saved in this object. + * + * @throws EDAMUserException
      + *
    • BAD_DATA_FORMAT "SavedSearch.name" - invalid length or pattern + *
    • + *
    • BAD_DATA_FORMAT "SavedSearch.query" - invalid length + *
    • + *
    • DATA_CONFLICT "SavedSearch.name" - name already in use + *
    • + *
    • LIMIT_REACHED "SavedSearch" - at max number of searches + *
    • + *
    + */ + Types.SavedSearch createSearch(1: string authenticationToken, + 2: Types.SavedSearch search) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Submits search changes to the service. The provided data must include + * the search's guid field for identification. The service will apply + * updates to the following search fields: name, query, and scope. + * + * @param search + * The search object containing the requested changes. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException
      + *
    • BAD_DATA_FORMAT "SavedSearch.name" - invalid length or pattern + *
    • + *
    • BAD_DATA_FORMAT "SavedSearch.query" - invalid length + *
    • + *
    • DATA_CONFLICT "SavedSearch.name" - name already in use + *
    • + *
    • PERMISSION_DENIED "SavedSearch" - user doesn't own tag + *
    • + *
    + * + * @throws EDAMNotFoundException
      + *
    • "SavedSearch.guid" - not found, by GUID + *
    • + *
    + */ + i32 updateSearch(1: string authenticationToken, + 2: Types.SavedSearch search) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Permanently deletes the saved search with the provided GUID, if present. + *

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

      + *
    • BAD_DATA_FORMAT "SavedSearch.guid" - if the guid parameter is empty + *
    • + *
    • PERMISSION_DENIED "SavedSearch" - user doesn't own + *
    • + *
    + * + * @throws EDAMNotFoundException
      + *
    • "SavedSearch.guid" - not found, by GUID + *
    • + *
    + */ + i32 expungeSearch(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Finds the position of a note within a sorted subset of all of the user's + * notes. This may be useful for thin clients that are displaying a paginated + * listing of a large account, which need to know where a particular note + * sits in the list without retrieving all notes first. + * + * @param authenticationToken + * Must be a valid token for the user's account unless the NoteFilter + * 'notebookGuid' is the GUID of a public notebook. + * + * @param filter + * The list of criteria that will constrain the notes to be returned. + * + * @param guid + * The GUID of the note to be retrieved. + * + * @return + * If the note with the provided GUID is found within the matching note + * list, this will return the offset of that note within that list (where + * the first offset is 0). If the note is not found within the set of + * notes, this will return -1. + * + * @throws EDAMUserException
      + *
    • BAD_DATA_FORMAT "offset" - not between 0 and EDAM_USER_NOTES_MAX + *
    • + *
    • BAD_DATA_FORMAT "maxNotes" - not between 0 and EDAM_USER_NOTES_MAX + *
    • + *
    • BAD_DATA_FORMAT "NoteFilter.notebookGuid" - if malformed + *
    • + *
    • BAD_DATA_FORMAT "NoteFilter.tagGuids" - if any are malformed + *
    • + *
    • BAD_DATA_FORMAT "NoteFilter.words" - if search string too long + *
    • + * + * @throws EDAMNotFoundException
        + *
      • "Notebook.guid" - not found, by GUID + *
      • + *
      • "Note.guid" - not found, by GUID + *
      • + *
      + */ + i32 findNoteOffset(1: string authenticationToken, + 2: NoteFilter filter, + 3: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Used to find the high-level information about a set of the notes from a + * user's account based on various criteria specified via a NoteFilter object. + *

      + * Web applications that wish to periodically check for new content in a user's + * Evernote account should consider using webhooks instead of polling this API. + * See http://dev.evernote.com/documentation/cloud/chapters/polling_notification.php + * for more information. + * + * @param authenticationToken + * Must be a valid token for the user's account unless the NoteFilter + * 'notebookGuid' is the GUID of a public notebook. + * + * @param filter + * The list of criteria that will constrain the notes to be returned. + * + * @param offset + * The numeric index of the first note to show within the sorted + * results. The numbering scheme starts with "0". This can be used for + * pagination. + * + * @param maxNotes + * The maximum notes to return in this query. The service will return a set + * of notes that is no larger than this number, but may return fewer notes + * if needed. The NoteList.totalNotes field in the return value will + * indicate whether there are more values available after the returned set. + * Currently, the service will not return more than 250 notes in a single request, + * but this number may change in the future. + * + * @param resultSpec + * This specifies which information should be returned for each matching + * Note. The fields on this structure can be used to eliminate data that + * the client doesn't need, which will reduce the time and bandwidth + * to receive and process the reply. + * + * @return + * The list of notes that match the criteria. + * The Notes.sharedNotes field will not be set. + * + * @throws EDAMUserException

        + *
      • BAD_DATA_FORMAT "offset" - not between 0 and EDAM_USER_NOTES_MAX + *
      • + *
      • BAD_DATA_FORMAT "maxNotes" - not between 0 and EDAM_USER_NOTES_MAX + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.notebookGuid" - if malformed + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.tagGuids" - if any are malformed + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.words" - if search string too long + *
      • + *
      + * + * @throws EDAMNotFoundException
        + *
      • "Notebook.guid" - not found, by GUID + *
      • + *
      + */ + NotesMetadataList findNotesMetadata(1: string authenticationToken, + 2: NoteFilter filter, + 3: i32 offset, + 4: i32 maxNotes, + 5: NotesMetadataResultSpec resultSpec) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + + /** + * This function is used to determine how many notes are found for each + * notebook and tag in the user's account, given a current set of filter + * parameters that determine the current selection. This function will + * return a structure that gives the note count for each notebook and tag + * that has at least one note under the requested filter. Any notebook or + * tag that has zero notes in the filtered set will not be listed in the + * reply to this function (so they can be assumed to be 0). + * + * @param authenticationToken + * Must be a valid token for the user's account unless the NoteFilter + * 'notebookGuid' is the GUID of a public notebook. + * + * @param filter + * The note selection filter that is currently being applied. The note + * counts are to be calculated with this filter applied to the total set + * of notes in the user's account. + * + * @param withTrash + * If true, then the NoteCollectionCounts.trashCount will be calculated + * and supplied in the reply. Otherwise, the trash value will be omitted. + * + * @throws EDAMUserException
        + *
      • BAD_DATA_FORMAT "NoteFilter.notebookGuid" - if malformed
      • + *
      • BAD_DATA_FORMAT "NoteFilter.notebookGuids" - if any are malformed
      • + *
      • BAD_DATA_FORMAT "NoteFilter.words" - if search string too long
      • + * + * @throws EDAMNotFoundException
          + *
        • "Notebook.guid" - not found, by GUID
        • + *
        + */ + NoteCollectionCounts findNoteCounts(1: string authenticationToken, + 2: NoteFilter filter, + 3: bool withTrash) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns the current state of the note in the service with the provided + * GUID. The ENML contents of the note will only be provided if the + * 'withContent' parameter is true. The service will include the meta-data + * for each resource in the note, but the binary content depends + * on whether it is explicitly requested in resultSpec parameter. + * If the Note is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). The applicationData + * fields are returned as keysOnly. + * + * @param authenticationToken + * An authentication token that grants the caller access to the requested note. + * + * @param guid + * The GUID of the note to be retrieved. + * + * @param resultSpec + * A structure specifying the fields of the note that the caller would like to get. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + Types.Note getNoteWithResultSpec(1: string authenticationToken, + 2: Types.Guid guid, + 3: NoteResultSpec resultSpec) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * DEPRECATED. See getNoteWithResultSpec. + * + * This function is equivalent to getNoteWithResultSpec, with each of the boolean parameters + * mapping to the equivalent field of a NoteResultSpec. The Note.sharedNotes field is never + * populated on the returned note. To get a note with its shares, use getNoteWithResultSpec. + */ + Types.Note getNote(1: string authenticationToken, + 2: Types.Guid guid, + 3: bool withContent, + 4: bool withResourcesData, + 5: bool withResourcesRecognition, + 6: bool withResourcesAlternateData) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Get all of the application data for the note identified by GUID, + * with values returned within the LazyMap fullMap field. + * If there are no applicationData entries, then a LazyMap + * with an empty fullMap will be returned. If your application + * only needs to fetch its own applicationData entry, use + * getNoteApplicationDataEntry instead. + */ + Types.LazyMap getNoteApplicationData(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Get the value of a single entry in the applicationData map + * for the note identified by GUID. + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - note not found, by GUID
        • + *
        • "NoteAttributes.applicationData.key" - note not found, by key
        • + *
        + */ + string getNoteApplicationDataEntry(1: string authenticationToken, + 2: Types.Guid guid, + 3: string key) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Update, or create, an entry in the applicationData map for + * the note identified by guid. + */ + i32 setNoteApplicationDataEntry(1: string authenticationToken, + 2: Types.Guid guid, + 3: string key, + 4: string value) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Remove an entry identified by 'key' from the applicationData map for + * the note identified by 'guid'. Silently ignores an unset of a + * non-existing key. + */ + i32 unsetNoteApplicationDataEntry(1: string authenticationToken, + 2: Types.Guid guid, + 3: string key) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns XHTML contents of the note with the provided GUID. + * If the Note is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). + * + * @param guid + * The GUID of the note to be retrieved. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + string getNoteContent(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns a block of the extracted plain text contents of the note with the + * provided GUID. This text can be indexed for search purposes by a light + * client that doesn't have capabilities to extract all of the searchable + * text content from the note and its resources. + * + * If the Note is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). + * + * @param guid + * The GUID of the note to be retrieved. + * + * @param noteOnly + * If true, this will only return the text extracted from the ENML contents + * of the note itself. If false, this will also include the extracted text + * from any text-bearing resources (PDF, recognized images) + * + * @param tokenizeForIndexing + * If true, this will break the text into cleanly separated and sanitized + * tokens. If false, this will return the more raw text extraction, with + * its original punctuation, capitalization, spacing, etc. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + string getNoteSearchText(1: string authenticationToken, + 2: Types.Guid guid, + 3: bool noteOnly, + 4: bool tokenizeForIndexing) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + + /** + * Returns a block of the extracted plain text contents of the resource with + * the provided GUID. This text can be indexed for search purposes by a light + * client that doesn't have capability to extract all of the searchable + * text content from a resource. + * + * If the Resource is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). + * + * @param guid + * The GUID of the resource to be retrieved. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        + */ + string getResourceSearchText(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns a list of the names of the tags for the note with the provided + * guid. This can be used with authentication to get the tags for a + * user's own note, or can be used without valid authentication to retrieve + * the names of the tags for a note in a public notebook. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + list getNoteTagNames(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Asks the service to make a note with the provided set of information. + * + * @param note + * A Note object containing the desired fields to be populated on + * the service. + * + * @return + * The newly created Note from the service. The server-side + * GUIDs for the Note and any Resources will be saved in this object. + * The service will include the meta-data + * for each resource in the note, but the binary contents of the resources + * and their recognition data will be omitted (except Recognition Resource body, + * for which the behavior is unspecified). + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.title" - invalid length or pattern + *
        • + *
        • BAD_DATA_FORMAT "Note.content" - invalid length for ENML content + *
        • + *
        • BAD_DATA_FORMAT "Resource.mime" - invalid resource MIME type + *
        • + *
        • BAD_DATA_FORMAT "NoteAttributes.*" - bad resource string + *
        • + *
        • BAD_DATA_FORMAT "ResourceAttributes.*" - bad resource string + *
        • + *
        • DATA_CONFLICT "Note.deleted" - deleted time set on active note + *
        • + *
        • DATA_REQUIRED "Resource.data" - resource data body missing + *
        • + *
        • ENML_VALIDATION "*" - note content doesn't validate against DTD + *
        • + *
        • LIMIT_REACHED "Note" - at max number per account + *
        • + *
        • LIMIT_REACHED "Note.size" - total note size too large + *
        • + *
        • LIMIT_REACHED "Note.resources" - too many resources on Note + *
        • + *
        • LIMIT_REACHED "Note.tagGuids" - too many Tags on Note + *
        • + *
        • LIMIT_REACHED "Resource.data.size" - resource too large + *
        • + *
        • LIMIT_REACHED "NoteAttribute.*" - attribute string too long + *
        • + *
        • LIMIT_REACHED "ResourceAttribute.*" - attribute string too long + *
        • + *
        • PERMISSION_DENIED "Note.notebookGuid" - NB not owned by user + *
        • + *
        • QUOTA_REACHED "Accounting.uploadLimit" - note exceeds upload quota + *
        • + *
        • BAD_DATA_FORMAT "Tag.name" - Note.tagNames was provided, and one + * of the specified tags had an invalid length or pattern + *
        • + *
        • LIMIT_REACHED "Tag" - Note.tagNames was provided, and the required + * new tags would exceed the maximum number per account + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.notebookGuid" - not found, by GUID + *
        • + *
        + */ + Types.Note createNote(1: string authenticationToken, + 2: Types.Note note) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Submit a set of changes to a note to the service. The provided data + * must include the note's guid field for identification. The note's + * title must also be set. + * + * @param note + * A Note object containing the desired fields to be populated on + * the service. With the exception of the note's title and guid, fields + * that are not being changed do not need to be set. If the content is not + * being modified, note.content should be left unset. If the list of + * resources is not being modified, note.resources should be left unset. + * + * @return + * The Note.sharedNotes field will not be set. + * The service will include the meta-data + * for each resource in the note, but the binary contents of the resources + * and their recognition data will be omitted. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.title" - invalid length or pattern + *
        • + *
        • BAD_DATA_FORMAT "Note.content" - invalid length for ENML body + *
        • + *
        • BAD_DATA_FORMAT "NoteAttributes.*" - bad resource string + *
        • + *
        • BAD_DATA_FORMAT "ResourceAttributes.*" - bad resource string + *
        • + *
        • BAD_DATA_FORMAT "Resource.mime" - invalid resource MIME type + *
        • + *
        • DATA_CONFLICT "Note.deleted" - deleted time set on active note + *
        • + *
        • DATA_REQUIRED "Resource.data" - resource data body missing + *
        • + *
        • ENML_VALIDATION "*" - note content doesn't validate against DTD + *
        • + *
        • LIMIT_REACHED "Note.tagGuids" - too many Tags on Note + *
        • + *
        • LIMIT_REACHED "Note.resources" - too many resources on Note + *
        • + *
        • LIMIT_REACHED "Note.size" - total note size too large + *
        • + *
        • LIMIT_REACHED "Resource.data.size" - resource too large + *
        • + *
        • LIMIT_REACHED "NoteAttribute.*" - attribute string too long + *
        • + *
        • LIMIT_REACHED "ResourceAttribute.*" - attribute string too long + *
        • + *
        • PERMISSION_DENIED "Note.notebookGuid" - user doesn't own destination + *
        • PERMISSION_DENIED "Note.tags" - user doesn't have permission to + * modify the note's tags. note.tags must be unset. + *
        • + *
        • PERMISSION_DENIED "Note.attributes" - user doesn't have permission + * to modify the note's attributes. note.attributes must be unset. + *
        • + *
        • QUOTA_REACHED "Accounting.uploadLimit" - note exceeds upload quota + *
        • + *
        • BAD_DATA_FORMAT "Tag.name" - Note.tagNames was provided, and one + * of the specified tags had an invalid length or pattern + *
        • + *
        • LIMIT_REACHED "Tag" - Note.tagNames was provided, and the required + * new tags would exceed the maximum number per account + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - note not found, by GUID + *
        • + *
        • "Note.notebookGuid" - if notebookGuid provided, but not found + *
        • + *
        + */ + Types.Note updateNote(1: string authenticationToken, + 2: Types.Note note) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Moves the note into the trash. The note may still be undeleted, unless it + * is expunged. This is equivalent to calling updateNote() after setting + * Note.active = false + * + * @param guid + * The GUID of the note to delete. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException
          + *
        • PERMISSION_DENIED "Note" - user doesn't have permission to + * update the note. + *
        • + *
        + * + * @throws EDAMUserException
          + *
        • DATA_CONFLICT "Note.guid" - the note is already deleted + *
        • + *
        + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + i32 deleteNote(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Permanently removes a Note, and all of its Resources, + * from the service. + *

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

          + *
        • PERMISSION_DENIED "Note" - user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + i32 expungeNote(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Performs a deep copy of the Note with the provided GUID 'noteGuid' into + * the Notebook with the provided GUID 'toNotebookGuid'. + * The caller must be the owner of both the Note and the Notebook. + * This creates a new Note in the destination Notebook with new content and + * Resources that match all of the content and Resources from the original + * Note, but with new GUID identifiers. + * The original Note is not modified by this operation. + * The copied note is considered as an "upload" for the purpose of upload + * transfer limit calculation, so its size is added to the upload count for + * the owner. + * + * If the original note has been shared and has SharedNote records, the shares + * are NOT copied. + * + * @param noteGuid + * The GUID of the Note to copy. + * + * @param toNotebookGuid + * The GUID of the Notebook that should receive the new Note. + * + * @return + * The metadata for the new Note that was created. This will include the + * new GUID for this Note (and any copied Resources), but will not include + * the content body or the binary bodies of any Resources. + * + * @throws EDAMUserException
          + *
        • LIMIT_REACHED "Note" - at max number per account + *
        • + *
        • PERMISSION_DENIED "Notebook.guid" - destination not owned by user + *
        • + *
        • PERMISSION_DENIED "Note" - user doesn't own + *
        • + *
        • QUOTA_REACHED "Accounting.uploadLimit" - note exceeds upload quota + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Notebook.guid" - not found, by GUID + *
        • + *
        + */ + Types.Note copyNote(1: string authenticationToken, + 2: Types.Guid noteGuid, + 3: Types.Guid toNotebookGuid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns a list of the prior versions of a particular note that are + * saved within the service. These prior versions are stored to provide a + * recovery from unintentional removal of content from a note. The identifiers + * that are returned by this call can be used with getNoteVersion to retrieve + * the previous note. + * The identifiers will be listed from the most recent versions to the oldest. + * This call is only available for notes in Premium accounts. (I.e. access + * to past versions of Notes is a Premium-only feature.) + * + * @throws EDAMUserException
          + *
        • DATA_REQUIRED "Note.guid" - if GUID is null or empty string. + *
        • + *
        • BAD_DATA_FORMAT "Note.guid" - if GUID is not of correct length. + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID. + *
        • + *
        + */ + list listNoteVersions(1: string authenticationToken, + 2: Types.Guid noteGuid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * This can be used to retrieve a previous version of a Note after it has been + * updated within the service. The caller must identify the note (via its + * guid) and the version (via the updateSequenceNumber of that version). + * to find a listing of the stored version USNs for a note, call + * listNoteVersions. + * This call is only available for notes in Premium accounts. (I.e. access + * to past versions of Notes is a Premium-only feature.) + * + * @param noteGuid + * The GUID of the note to be retrieved. + * + * @param updateSequenceNum + * The USN of the version of the note that is being retrieved + * + * @param withResourcesData + * If true, any Resource elements in this Note will include the binary + * contents of their 'data' field's body. + * + * @param withResourcesRecognition + * If true, any Resource elements will include the binary contents of the + * 'recognition' field's body if recognition data is present. + * + * @param withResourcesAlternateData + * If true, any Resource elements in this Note will include the binary + * contents of their 'alternateData' fields' body, if an alternate form + * is present. + * + * @throws EDAMUserException
          + *
        • DATA_REQUIRED "Note.guid" - if GUID is null or empty string. + *
        • + *
        • BAD_DATA_FORMAT "Note.guid" - if GUID is not of correct length. + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID. + *
        • + *
        • "Note.updateSequenceNumber" - the Note doesn't have a version with + * the corresponding USN. + *
        • + *
        + */ + Types.Note getNoteVersion(1: string authenticationToken, + 2: Types.Guid noteGuid, + 3: i32 updateSequenceNum, + 4: bool withResourcesData, + 5: bool withResourcesRecognition, + 6: bool withResourcesAlternateData) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns the current state of the resource in the service with the + * provided GUID. + * If the Resource is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). Only the + * keys for the applicationData will be returned. + * + * @param guid + * The GUID of the resource to be retrieved. + * + * @param withData + * If true, the Resource will include the binary contents of the + * 'data' field's body. + * + * @param withRecognition + * If true, the Resource will include the binary contents of the + * 'recognition' field's body if recognition data is present. + * + * @param withAttributes + * If true, the Resource will include the attributes + * + * @param withAlternateData + * If true, the Resource will include the binary contents of the + * 'alternateData' field's body, if an alternate form is present. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        + */ + Types.Resource getResource(1: string authenticationToken, + 2: Types.Guid guid, + 3: bool withData, + 4: bool withRecognition, + 5: bool withAttributes, + 6: bool withAlternateData) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Get all of the application data for the Resource identified by GUID, + * with values returned within the LazyMap fullMap field. + * If there are no applicationData entries, then a LazyMap + * with an empty fullMap will be returned. If your application + * only needs to fetch its own applicationData entry, use + * getResourceApplicationDataEntry instead. + */ + Types.LazyMap getResourceApplicationData(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Get the value of a single entry in the applicationData map + * for the Resource identified by GUID. + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - Resource not found, by GUID
        • + *
        • "ResourceAttributes.applicationData.key" - Resource not found, by key
        • + *
        + */ + string getResourceApplicationDataEntry(1: string authenticationToken, + 2: Types.Guid guid, + 3: string key) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Update, or create, an entry in the applicationData map for + * the Resource identified by guid. + */ + i32 setResourceApplicationDataEntry(1: string authenticationToken, + 2: Types.Guid guid, + 3: string key, + 4: string value) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Remove an entry identified by 'key' from the applicationData map for + * the Resource identified by 'guid'. + */ + i32 unsetResourceApplicationDataEntry(1: string authenticationToken, + 2: Types.Guid guid, + 3: string key) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Submit a set of changes to a resource to the service. This can be used + * to update the meta-data about the resource, but cannot be used to change + * the binary contents of the resource (including the length and hash). These + * cannot be changed directly without creating a new resource and removing the + * old one via updateNote. + * + * @param resource + * A Resource object containing the desired fields to be populated on + * the service. The service will attempt to update the resource with the + * following fields from the client: + *
          + *
        • guid: must be provided to identify the resource + *
        • + *
        • mime + *
        • + *
        • width + *
        • + *
        • height + *
        • + *
        • duration + *
        • + *
        • attributes: optional. if present, the set of attributes will + * be replaced. + *
        • + *
        + * + * @return + * The Update Sequence Number of the resource after the changes have been + * applied. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • BAD_DATA_FORMAT "Resource.mime" - invalid resource MIME type + *
        • + *
        • BAD_DATA_FORMAT "ResourceAttributes.*" - bad resource string + *
        • + *
        • LIMIT_REACHED "ResourceAttribute.*" - attribute string too long + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        + */ + i32 updateResource(1: string authenticationToken, + 2: Types.Resource resource) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns binary data of the resource with the provided GUID. For + * example, if this were an image resource, this would contain the + * raw bits of the image. + * If the Resource is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). + * + * @param guid + * The GUID of the resource to be retrieved. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        + */ + binary getResourceData(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns the current state of a resource, referenced by containing + * note GUID and resource content hash. + * + * @param noteGuid + * The GUID of the note that holds the resource to be retrieved. + * + * @param contentHash + * The MD5 checksum of the resource within that note. Note that + * this is the binary checksum, for example from Resource.data.bodyHash, + * and not the hex-encoded checksum that is used within an en-media + * tag in a note body. + * + * @param withData + * If true, the Resource will include the binary contents of the + * 'data' field's body. + * + * @param withRecognition + * If true, the Resource will include the binary contents of the + * 'recognition' field's body. + * + * @param withAlternateData + * If true, the Resource will include the binary contents of the + * 'alternateData' field's body, if an alternate form is present. + * + * @throws EDAMUserException
          + *
        • DATA_REQUIRED "Note.guid" - noteGuid param missing + *
        • + *
        • DATA_REQUIRED "Note.contentHash" - contentHash param missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note" - not found, by guid + *
        • + *
        • "Resource" - not found, by hash + *
        • + *
        + */ + Types.Resource getResourceByHash(1: string authenticationToken, + 2: Types.Guid noteGuid, + 3: binary contentHash, + 4: bool withData, + 5: bool withRecognition, + 6: bool withAlternateData) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns the binary contents of the recognition index for the resource + * with the provided GUID. If the caller asks about a resource that has + * no recognition data, this will throw EDAMNotFoundException. + * If the Resource is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). + * + * @param guid + * The GUID of the resource whose recognition data should be retrieved. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        • "Resource.recognition" - resource has no recognition + *
        • + *
        + */ + binary getResourceRecognition(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * If the Resource with the provided GUID has an alternate data representation + * (indicated via the Resource.alternateData field), then this request can + * be used to retrieve the binary contents of that alternate data file. + * If the caller asks about a resource that has no alternate data form, this + * will throw EDAMNotFoundException. + * + * @param guid + * The GUID of the resource whose recognition data should be retrieved. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        • "Resource.alternateData" - resource has no recognition + *
        • + *
        + */ + binary getResourceAlternateData(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns the set of attributes for the Resource with the provided GUID. + * If the Resource is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). + * + * @param guid + * The GUID of the resource whose attributes should be retrieved. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        + */ + Types.ResourceAttributes getResourceAttributes(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + + /** + *

        + * Looks for a user account with the provided userId on this NoteStore + * shard and determines whether that account contains a public notebook + * with the given URI. If the account is not found, or no public notebook + * exists with this URI, this will throw an EDAMNotFoundException, + * otherwise this will return the information for that Notebook. + *

        + *

        + * If a notebook is visible on the web with a full URL like + * http://www.evernote.com/pub/sethdemo/api + * Then 'sethdemo' is the username that can be used to look up the userId, + * and 'api' is the publicUri. + *

        + * + * @param userId + * The numeric identifier for the user who owns the public notebook. + * To find this value based on a username string, you can invoke + * UserStore.getPublicUserInfo + * + * @param publicUri + * The uri string for the public notebook, from Notebook.publishing.uri. + * + * @throws EDAMNotFoundException
          + *
        • "Publishing.uri" - not found, by URI
        • + *
        + * + * @throws EDAMSystemException
          + *
        • TAKEN_DOWN "PublicNotebook" - The specified public notebook is + * taken down (for all requesters).
        • + *
        • TAKEN_DOWN "Country" - The specified public notebook is taken + * down for the requester because of an IP-based country lookup.
        • + *
        + */ + Types.Notebook getPublicNotebook(1: Types.UserID userId, + 2: string publicUri) + throws (1: Errors.EDAMSystemException systemException, + 2: Errors.EDAMNotFoundException notFoundException), + + + /** + * @Deprecated for first-party clients. See createOrUpdateNotebookShares. + * + * Share a notebook with an email address, and optionally to a specific + * recipient. If an existing SharedNotebook associated with + * sharedNotebook.notebookGuid is found by recipientUsername or email, then + * the values of sharedNotebook will be used to update the existing record, + * else a new record will be created. + * + * If recipientUsername is set and there is already a SharedNotebook + * for that Notebook with that recipientUsername and the privileges on the + * existing notebook are lower, than on this one, this will update the + * privileges and sharerUserId. If there isn't an existing SharedNotebook for + * recipientUsername, this will create and return a shared notebook for that + * email and recipientUsername. If recipientUsername is not set and there + * already is a SharedNotebook for a Notebook for that email address and the + * privileges on the existing SharedNotebook are lower than on this one, this + * will update the privileges and sharerUserId, and return the updated + * SharedNotebook. Otherwise, this will create and return a SharedNotebook for + * the email address. + * + * If the authenticationToken is a Business auth token, recipientUsername is + * set and the recipient is in the same business as the business auth token, + * this method will also auto-join the business user to the SharedNotebook - + * that is it will set serviceJoined on the SharedNotebook and create a + * LinkedNotebook on the recipient's account pointing to the SharedNotebook. + * The LinkedNotebook creation happens out-of-band, so there will be a delay + * on the order of half a minute between the SharedNotebook and LinkedNotebook + * creation. + * + * Also handles sending an email to the email addresses: if a SharedNotebook + * is being created, this will send the shared notebook invite email, and + * if a SharedNotebook already exists, it will send the shared notebook + * reminder email. Both these emails contain a link to join the notebook. + * If the notebook is being auto-joined, it sends an email with that + * information to the recipient. + * + * @param authenticationToken + * Must be an authentication token from the owner or a shared notebook + * authentication token or business authentication token with sufficient + * permissions to change invitations for a notebook. + * + * @param sharedNotebook + * A shared notebook object populated with the email address of the share + * recipient, the notebook guid and the access permissions. All other + * attributes of the shared object are ignored. The SharedNotebook.allowPreview + * field must be explicitly set with either a true or false value. + * + * @param message + * The sharer-defined message to put in the email sent out. + * + * @return + * The fully populated SharedNotebook object including the server assigned + * globalId which can both be used to uniquely identify the SharedNotebook. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "SharedNotebook.email" - if the email was not valid
        • + *
        • DATA_REQUIRED "SharedNotebook.privilege" - if the + * SharedNotebook.privilegeLevel was not set.
        • + *
        • BAD_DATA_FORMAT "SharedNotebook.requireLogin" - if requireLogin was + * set. requireLogin is deprecated.
        • + *
        • BAD_DATA_FORMAT "SharedNotebook.privilegeLevel" - if the + * SharedNotebook.privilegeLevel field was unset or set to GROUP.
        • + *
        • PERMISSION_DENIED "user" - if the email address on the authenticationToken's + owner's account is not confirmed.
        • + *
        • PERMISSION_DENIED "SharedNotebook.recipientSettings" - if + * recipientSettings is set in the sharedNotebook. Only the recipient + * can set these values via the setSharedNotebookRecipientSettings + * method.
        • + *
        • EDAMErrorCode.LIMIT_REACHED "SharedNotebook" - The notebook already has + * EDAM_NOTEBOOK_SHARED_NOTEBOOK_MAX shares.
        • + *
        + * @throws EDAMNotFoundException
          + *
        • Notebook.guid - if the notebookGuid is not a valid GUID for the user. + *
        • + *
        + */ + Types.SharedNotebook shareNotebook(1: string authenticationToken, + 2: Types.SharedNotebook sharedNotebook, + 3: string message) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * Share a notebook by a messaging thread ID or a list of contacts. This function is + * intended to be used in conjunction with Evernote messaging, and as such does not + * notify the recipient that a notebook has been shared with them. + * + * Sharing with a subset of participants on a thread is accomplished by specifying both + * a thread ID and a list of contacts. This ensures that even if those contacts are + * on the thread under a deactivated identity, the correct user (the one who has the + * given contact on the thread) receives the share. + * + * @param authenticationToken + * An authentication token that grants the caller permission to share the notebook. + * This should be an owner token if the notebook is owned by the caller. + * If the notebook is a business notebook to which the caller has full access, + * this should be their business authentication token. If the notebook is a shared + * (non-business) notebook to which the caller has full access, this should be the + * shared notebook authentication token returned by NoteStore.authenticateToNotebook. + * + * @param shareTemplate + * Specifies the GUID of the notebook to be shared, the privilege at which the notebook + * should be shared, and the recipient information. + * + * @return + * A structure containing the USN of the Notebook after the change and a list of created + * or updated SharedNotebooks. + * + * @throws EDAMUserException
          + *
        • DATA_REQUIRED "Notebook.guid" - if no notebook GUID was specified
        • + *
        • BAD_DATA_FORMAT "Notebook.guid" - if shareTemplate.notebookGuid is not a + * valid GUID
        • + *
        • DATA_REQUIRED "shareTemplate" - if the shareTemplate parameter was missing
        • + *
        • DATA_REQUIRED "NotebookShareTemplate.privilege" - if no privilege was + * specified
        • + *
        • DATA_CONFLICT "NotebookShareTemplate.privilege" - if the specified privilege + * is not allowed.
        • + *
        • DATA_REQUIRED "NotebookShareTemplate.recipients" - if no recipients were + * specified, either by thread ID or as a list of contacts
        • + *
        • LIMIT_REACHED "SharedNotebook" - if the notebook has reached its maximum + * number of shares
        • + *
        + * + * @throws EDAMInvalidContactsException
          + *
        • "NotebookShareTemplate.recipients" - if one or more of the recipients specified + * in shareTemplate.recipients was not syntactically valid, or if attempting to + * share a notebook with an Evernote identity that the sharer does not have a + * connection to. The exception will specify which recipients were invalid.
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Notebook.guid" - if no notebook with the specified GUID was found
        • + *
        • "NotebookShareTemplate.recipientThreadId" - if the recipient thread ID was + * specified, but no thread with that ID exists
        • + *
        + */ + CreateOrUpdateNotebookSharesResult + createOrUpdateNotebookShares(1: string authenticationToken, + 2: NotebookShareTemplate shareTemplate) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException + 4: Errors.EDAMInvalidContactsException invalidContactsException), + + /** + * @Deprecated See createOrUpdateNotebookShares and manageNotebookShares. + */ + i32 updateSharedNotebook(1: string authenticationToken, + 2: Types.SharedNotebook sharedNotebook) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * Set values for the recipient settings associated with a notebook share. Only the + * recipient of the share can update their recipient settings. + * + * If you do not wish to, or cannot, change one of the recipient settings fields, + * you must leave that field unset in recipientSettings. + * This method will skip that field for updates and attempt to leave the existing value as + * it is. + * + * If recipientSettings.inMyList is false, both reminderNotifyInApp and reminderNotifyEmail + * will be either left as null or converted to false (if currently true). + * + * To unset a notebook's stack, pass in the empty string for the stack field. + * + * @param authenticationToken The owner authentication token for the recipient of the share. + * + * @return The updated Notebook with the new recipient settings. Note that some of the + * recipient settings may differ from what was requested. Clients should update their state + * based on this return value. + * + * @throws EDAMNotFoundException
          + *
        • Notebook.guid - Thrown if the service does not have a notebook record with the + * notebookGuid on the given shard.
        • + *
        • Publishing.publishState - Thrown if the business notebook is not shared with the + * user and is also not published to their business.
        • + *
        + * + * @throws EDAMUserException
          + *
        • PEMISSION_DENIED "authenticationToken" - If the owner of the given token is not + * allowed to set recipient settings on the specified notebook.
        • + *
        • DATA_CONFLICT "recipientSettings.reminderNotifyEmail" - Setting reminderNotifyEmail + * is allowed only for notebooks which belong to the same business as the user.
        • + *
        • DATA_CONFLICT "recipientSettings.inMyList" - If the request is setting inMyList + * to false and any of reminder* settings to true.
        • + *
        + */ + Types.Notebook setNotebookRecipientSettings( + 1: string authenticationToken, + 2: string notebookGuid, + 3: Types.NotebookRecipientSettings recipientSettings) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * Lists the collection of shared notebooks for all notebooks in the + * users account. + * + * @return + * The list of all SharedNotebooks for the user + */ + list listSharedNotebooks(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * Asks the service to make a linked notebook with the provided name, username + * of the owner and identifiers provided. A linked notebook can be either a + * link to a public notebook or to a private shared notebook. + * + * @param linkedNotebook + * The desired fields for the linked notebook must be provided on this + * object. The name of the linked notebook must be set. Either a username + * uri or a shard id and share key must be provided otherwise a + * EDAMUserException is thrown. + * + * @return + * The newly created LinkedNotebook. The server-side id will be + * saved in this object's 'id' field. + * + * @throws EDAMUserException
          + *
        • DATA_REQUIRED "LinkedNotebook.shareName" - missing shareName + *
        • BAD_DATA_FORMAT "LinkedNotebook.name" - invalid shareName length or pattern + *
        • + *
        • BAD_DATA_FORMAT "LinkedNotebook.username" - bad username format + *
        • + *
        • BAD_DATA_FORMAT "LinkedNotebook.uri" - + * if public notebook set but bad uri + *
        • + *
        • DATA_REQUIRED "LinkedNotebook.shardId" - + * if private notebook but shard id not provided + *
        • + *
        • BAD_DATA_FORMAT "LinkedNotebook.stack" - invalid stack name length or pattern + *
        • + *
        + * + * @throws EDAMSystemException
          + *
        • BAD_DATA_FORMAT "LinkedNotebook.sharedNotebookGlobalId" - + * if a bad global identifer was set on a private notebook + *
        • + *
        + */ + Types.LinkedNotebook createLinkedNotebook(1: string authenticationToken, + 2: Types.LinkedNotebook linkedNotebook) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * @param linkedNotebook + * Updates the name of a linked notebook. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException
          + *
        • DATA_REQUIRED "LinkedNotebook.shareName" - missing shareName + *
        • + *
        • BAD_DATA_FORMAT "LinkedNotebook.shareName" - invalid shareName length or pattern + *
        • + *
        • BAD_DATA_FORMAT "LinkedNotebook.stack" - invalid stack name length or pattern + *
        • + *
        + */ + i32 updateLinkedNotebook(1: string authenticationToken, + 2: Types.LinkedNotebook linkedNotebook) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * Returns a list of linked notebooks + */ + list listLinkedNotebooks(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * Permanently expunges the linked notebook from the account. + *

        + * NOTE: This function is generally not available to third party applications. + * Calls will result in an EDAMUserException with the error code + * PERMISSION_DENIED. + * + * @param guid + * The LinkedNotebook.guid field of the LinkedNotebook to permanently remove + * from the account. + */ + i32 expungeLinkedNotebook(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * Asks the service to produce an authentication token that can be used to + * access the contents of a shared notebook from someone else's account. + * This authenticationToken can be used with the various other NoteStore + * calls to find and retrieve notes, and if the permissions in the shared + * notebook are sufficient, to make changes to the contents of the notebook. + * + * @param shareKeyOrGlobalId + * May be one of the following: + *

          + *
        • A share key for a shared notebook that was granted to some recipient + * Must be used if you are joining a notebook unless it was shared via + * createOrUpdateNotebookShares. Share keys are delivered out-of-band + * and are generally not available to clients. For security reasons, + * share keys may be invalidated at the discretion of the service. + *
        • + *
        • The shared notebook global identifier. May be used to access a + * notebook that is already joined. + *
        • + *
        • The Notebook GUID. May be used to access a notebook that was already + * joined, or to access a notebook that was shared with the recipient + * via createOrUpdateNotebookShares. + *
        • + *
        + * + * @param authenticationToken + * If a non-empty string is provided, this is the full user-based + * authentication token that identifies the user who is currently logged in + * and trying to access the shared notebook. + * If this string is empty, the service will attempt to authenticate to the + * shared notebook without any logged in user. + * + * @throws EDAMSystemException
          + *
        • BAD_DATA_FORMAT "shareKey" - invalid shareKey string
        • + *
        • INVALID_AUTH "shareKey" - bad signature on shareKey string
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "SharedNotebook.id" - the shared notebook no longer exists
        • + *
        + * + * @throws EDAMUserException
          + *
        • DATA_REQUIRED "authenticationToken" - the share requires login, and + * no valid authentication token was provided. + *
        • + *
        • PERMISSION_DENIED "SharedNotebook.username" - share requires login, + * and another username has already been bound to this notebook. + *
        • + *
        + */ + UserStore.AuthenticationResult + authenticateToSharedNotebook(1: string shareKeyOrGlobalId, + 2: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * This function is used to retrieve extended information about a shared + * notebook by a guest who has already authenticated to access that notebook. + * This requires an 'authenticationToken' parameter which should be the + * resut of a call to authenticateToSharedNotebook(...). + * I.e. this is the token that gives access to the particular shared notebook + * in someone else's account -- it's not the authenticationToken for the + * owner of the notebook itself. + * + * @param authenticationToken + * Should be the authentication token retrieved from the reply of + * authenticateToSharedNotebook(), proving access to a particular shared + * notebook. + * + * @throws EDAMUserException
          + *
        • PERMISSION_DENIED "authenticationToken" - + * authentication token doesn't correspond to a valid shared notebook + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "SharedNotebook.id" - the shared notebook no longer exists + *
        • + *
        + */ + Types.SharedNotebook getSharedNotebookByAuth(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * Attempts to send a single note to one or more email recipients. + *

        + * NOTE: This function is generally not available to third party applications. + * Calls will result in an EDAMUserException with the error code + * PERMISSION_DENIED. + * + * @param authenticationToken + * The note will be sent as the user logged in via this token, using that + * user's registered email address. If the authenticated user doesn't + * have permission to read that note, the emailing will fail. + * + * @param parameters + * The note must be specified either by GUID (in which case it will be + * sent using the existing data in the service), or else the full Note + * must be passed to this call. This also specifies the additional + * email fields that will be used in the email. + * + * @throws EDAMUserException

          + *
        • LIMIT_REACHED "NoteEmailParameters.toAddresses" - + * The email can't be sent because this would exceed the user's daily + * email limit. + *
        • + *
        • BAD_DATA_FORMAT "(email address)" - + * email address malformed + *
        • + *
        • DATA_REQUIRED "NoteEmailParameters.toAddresses" - + * if there are no To: or Cc: addresses provided. + *
        • + *
        • DATA_REQUIRED "Note.title" - + * if the caller provides a Note parameter with no title + *
        • + *
        • DATA_REQUIRED "Note.content" - + * if the caller provides a Note parameter with no content + *
        • + *
        • ENML_VALIDATION "*" - note content doesn't validate against DTD + *
        • + *
        • DATA_REQUIRED "NoteEmailParameters.note" - + * if no guid or note provided + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + void emailNote(1: string authenticationToken, + 2: NoteEmailParameters parameters) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * If this note is not already shared publicly (via its own direct URL), then this + * will start sharing that note. + * This will return the secret "Note Key" for this note that + * can currently be used in conjunction with the Note's GUID to gain direct + * read-only access to the Note. + * If the note is already shared, then this won't make any changes to the + * note, and the existing "Note Key" will be returned. The only way to change + * the Note Key for an existing note is to stopSharingNote first, and then + * call this function. + * + * @param guid + * The GUID of the note to be shared. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID
        • + *
        + */ + string shareNote(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * If this note is shared publicly then this will stop sharing that note + * and invalidate its "Note Key", so any existing URLs to access that Note + * will stop working. + * + * If the Note is not shared, then this function will do nothing. + * + * This function does not remove invididual shares for the note. To remove + * individual shares, see stopSharingNoteWithRecipients. + * + * @param guid + * The GUID of the note to be un-shared. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID
        • + *
        + */ + void stopSharingNote(1: string authenticationToken, + 2: Types.Guid guid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * Asks the service to produce an authentication token that can be used to + * access the contents of a single Note which was individually shared + * from someone's account. + * This authenticationToken can be used with the various other NoteStore + * calls to find and retrieve the Note and its directly-referenced children. + * + * @param guid + * The GUID identifying this Note on this shard. + * + * @param noteKey + * The 'noteKey' identifier from the Note that was originally created via + * a call to shareNote() and then given to a recipient to access. + * + * @param authenticationToken + * An optional authenticationToken that identifies the user accessing the + * shared note. This parameter may be required to access some shared notes. + * + * @throws EDAMUserException
          + *
        • PERMISSION_DENIED "Note" - the Note with that GUID is either not + * shared, or the noteKey doesn't match the current key for this note + *
        • + *
        • PERMISSION_DENIED "authenticationToken" - an authentication token is + * required to access this Note, but either no authentication token or a + * "non-owner" authentication token was provided. + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "guid" - the note with that GUID is not found + *
        • + *
        + * + * @throws EDAMSystemException
          + *
        • TAKEN_DOWN "Note" - The specified shared note is taken down (for + * all requesters). + *
        • + *
        • TAKEN_DOWN "Country" - The specified shared note is taken down + * for the requester because of an IP-based country lookup. + *
        + *
      + */ + UserStore.AuthenticationResult + authenticateToSharedNote(1: string guid, + 2: string noteKey, + 3: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * Identify related entities on the service, such as notes, + * notebooks, tags and users in a business related to notes or content. + * + * @param query + * The information about which we are finding related entities. + * + * @param resultSpec + * Allows the client to indicate the type and quantity of + * information to be returned, allowing a saving of time and + * bandwidth. + * + * @return + * The result of the query, with information considered + * to likely be relevantly related to the information + * described by the query. + * + * @throws EDAMUserException
        + *
      • BAD_DATA_FORMAT "RelatedQuery.plainText" - If you provided a + * a zero-length plain text value. + *
      • + *
      • BAD_DATA_FORMAT "RelatedQuery.noteGuid" - If you provided an + * invalid Note GUID, that is, one that does not match the constraints + * defined by EDAM_GUID_LEN_MIN, EDAM_GUID_LEN_MAX, EDAM_GUID_REGEX. + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.notebookGuid" - if malformed + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.tagGuids" - if any are malformed + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.words" - if search string too long + *
      • + *
      • PERMISSION_DENIED "Note" - If the caller does not have access to + * the note identified by RelatedQuery.noteGuid. + *
      • + *
      • PERMISSION_DENIED "authenticationToken" - If the caller has requested to + * findExperts in the context of a non business user (i.e. The authenticationToken + * is not a business auth token). + *
      • + *
      • DATA_REQUIRED "RelatedResultSpec" - If you did not not set any values + * in the result spec. + *
      • + *
      + * + * @throws EDAMNotFoundException
        + *
      • "RelatedQuery.noteGuid" - the note with that GUID is not + * found, if that field has been set in the query. + *
      • + *
      + */ + RelatedResult findRelated(1: string authenticationToken, + 2: RelatedQuery query, + 3: RelatedResultSpec resultSpec) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Perform the same operation as updateNote() would provided that the update + * sequence number on the parameter Note object matches the current update sequence + * number that the service has for the note. If they do not match, then + * no update is performed and the return value will have the current server + * state in the note field and updated will be false. If the update sequence + * numbers between the client and server do match, then the note will be updated + * and the note field of the return value will be returned as it would be for the + * updateNote method. This method allows you to check for an update to the note + * on the service, by another client instance, from when you obtained the + * note state as a baseline for your edits and the time when you wish to save your + * edits. If your client can merge the conflict, you can avoid overwriting changes + * that were saved to the service by the other client. + * + * See the updateNote method for information on the exceptions and parameters for + * this method. The only difference is that you must have an update sequence number + * defined on the note parameter (equal to the USN of the note as synched to the + * client), and the following additional exceptions might be thrown. + * + * @throws EDAMUserException
        + *
      • DATA_REQUIRED "Note.updateSequenceNum" - If the update sequence number was + * not provided. This includes a value that is set as 0.
      • + *
      • BAD_DATA_FORMAT "Note.updateSequenceNum" - If the note has an update + * sequence number that is larger than the current server value, which should + * not happen if your client is working correctly.
      • + *
      + */ + UpdateNoteIfUsnMatchesResult updateNoteIfUsnMatches(1: string authenticationToken, + 2: Types.Note note) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * Manage invitations and memberships associated with a given notebook. + * + * Note: Beta method! This method is currently intended for + * limited use by Evernote clients that have discussed using this + * routine with the platform team. + * + * @param parameters A structure containing all parameters for the updates. + * See the structure documentation for details. + * + * @throws EDAMUserException
        + *
      • EDAMErrorCode.LIMIT_REACHED "SharedNotebook" - Trying to share a + * notebook while the notebook already has EDAM_NOTEBOOK_SHARED_NOTEBOOK_MAX + * shares.
      • + *
      + */ + ManageNotebookSharesResult manageNotebookShares(1: string authenticationToken, + 2: ManageNotebookSharesParameters parameters) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException), + + /** + * Return the share relationships for the given notebook, including + * both the invitations and the memberships. + * + * Note: Beta method! This method is currently intended for + * limited use by Evernote clients that have discussed using this + * routine with the platform team. + */ + ShareRelationships getNotebookShares(1: string authenticationToken, + 2: string notebookGuid) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMNotFoundException notFoundException, + 3: Errors.EDAMSystemException systemException) +} diff --git a/tests/evernote-thrift/src/Types.thrift b/tests/evernote-thrift/src/Types.thrift new file mode 100644 index 0000000..a9a2428 --- /dev/null +++ b/tests/evernote-thrift/src/Types.thrift @@ -0,0 +1,3112 @@ +/* + * Copyright 2007-2018 Evernote Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file contains the definitions of the Evernote data model as it + * is represented through the EDAM protocol. This is the "client-independent" + * view of the contents of a user's account. Each client will translate the + * neutral data model into an appropriate form for storage on that client. + */ + +include "Limits.thrift" + +namespace as3 com.evernote.edam.type +namespace java com.evernote.edam.type +namespace csharp Evernote.EDAM.Type +namespace py evernote.edam.type +namespace cpp evernote.edam +namespace rb Evernote.EDAM.Type +namespace php EDAM.Types +namespace cocoa EDAM +namespace perl EDAMTypes +namespace go edam + + +// =============================== typedefs ==================================== + +/** + * A monotonically incrementing number on each shard that identifies a cross shard + * cache invalidation event. + */ +typedef i64 InvalidationSequenceNumber + + +/** + * A type alias for the primary identifiers for Identity objects. + */ +typedef i64 IdentityID + + +/** + * Every Evernote account is assigned a unique numeric identifier which + * will not change for the life of the account. This is independent of + * the (string-based) "username" which is known by the user for login + * purposes. The user should have no reason to know their UserID. + */ +typedef i32 UserID + + +/** + * Most data elements within a user's account (e.g. notebooks, notes, tags, + * resources, etc.) are internally referred to using a globally unique + * identifier that is written in a standard string format. For example: + * + * "8743428c-ef91-4d05-9e7c-4a2e856e813a" + * + * The internal components of the GUID are not given any particular meaning: + * only the entire string is relevant as a unique identifier. + */ +typedef string Guid + + +/** + * An Evernote Timestamp is the date and time of an event in UTC time. + * This is expressed as a specific number of milliseconds since the + * standard base "epoch" of: + * + * January 1, 1970, 00:00:00 GMT + * + * NOTE: the time is expressed at the resolution of milliseconds, but + * the value is only precise to the level of seconds. This means that + * the last three (decimal) digits of the timestamp will be '000'. + * + * The Thrift IDL specification does not include a native date/time type, + * so this value is used instead. + * + * The service will accept timestamp values (e.g. for Note created and update + * times) between 1000-01-01 and 9999-12-31 + */ +typedef i64 Timestamp + +/** + * A sequence number for the MessageStore subsystem. + */ +typedef i64 MessageEventID + +/** + * A type alias for the primary identifiers for MessageThread objects. + */ +typedef i64 MessageThreadID + +// ============================= Enumerations ================================== + +/** + * This enumeration defines the possible permission levels for a user. + * Free accounts will have a level of NORMAL and paid Premium accounts + * will have a level of PREMIUM. + */ +enum PrivilegeLevel { + NORMAL = 1, + PREMIUM = 3, + VIP = 5, + MANAGER = 7, + SUPPORT = 8, + ADMIN = 9 +} + +/** + * This enumeration defines the possible tiers of service that a user may have. A + * ServiceLevel of BUSINESS signifies a business-only account, which can never be any + * other ServiceLevel. + */ +enum ServiceLevel { + BASIC = 1, + PLUS = 2, + PREMIUM = 3, + BUSINESS = 4 +} + +/** + * Every search query is specified as a sequence of characters. + * Currently, only the USER query format is supported. + */ +enum QueryFormat { + USER = 1, + SEXP = 2 +} + + +/** + * This enumeration defines the possible sort ordering for notes when + * they are returned from a search result. + */ +enum NoteSortOrder { + CREATED = 1, + UPDATED = 2, + RELEVANCE = 3, + UPDATE_SEQUENCE_NUMBER = 4, + TITLE = 5 +} + + +/** + * This enumeration defines the possible states of a premium account + * + * NONE: the user has never attempted to become a premium subscriber + * + * PENDING: the user has requested a premium account but their charge has not + * been confirmed + * + * ACTIVE: the user has been charged and their premium account is in good + * standing + * + * FAILED: the system attempted to charge the was denied. We will periodically attempt to + * re-validate their order. + * + * CANCELLATION_PENDING: the user has requested that no further charges be made + * but the current account is still active. + * + * CANCELED: the premium account was canceled either because of failure to pay + * or user cancelation. No more attempts will be made to activate the account. + */ +enum PremiumOrderStatus { + NONE = 0, + PENDING = 1, + ACTIVE = 2, + FAILED = 3, + CANCELLATION_PENDING = 4, + CANCELED = 5 +} + +/** + * Privilege levels for accessing shared notebooks. + * + * Note that as of 2014-04, FULL_ACCESS is synonymous with BUSINESS_FULL_ACCESS. If a + * user is a member of a business and has FULL_ACCESS privileges, then they will + * automatically be granted BUSINESS_FULL_ACCESS for notebooks in their business. This + * will happen implicitly when they attempt to access the corresponding notebooks of + * the business. BUSINESS_FULL_ACCESS is therefore deprecated. + * + * READ_NOTEBOOK: Recipient is able to read the contents of the shared notebook + * but does not have access to information about other recipients of the + * notebook or the activity stream information. + * + * MODIFY_NOTEBOOK_PLUS_ACTIVITY: Recipient has rights to read and modify the contents + * of the shared notebook, including the right to move notes to the trash and to create + * notes in the notebook. The recipient can also access information about other + * recipients and the activity stream. + * + * READ_NOTEBOOK_PLUS_ACTIVITY: Recipient has READ_NOTEBOOK rights and can also + * access information about other recipients and the activity stream. + * + * GROUP: If the user belongs to a group, such as a Business, that has a defined + * privilege level, use the privilege level of the group as the privilege for + * the individual. + * + * FULL_ACCESS: Recipient has full rights to the shared notebook and recipient lists, + * including privilege to revoke and create invitations and to change privilege + * levels on invitations for individuals. For members of a business, FULL_ACCESS + * privilege on business notebooks also grants the ability to change how the notebook + * will appear when shared with the business, including the rights to share and + * unshare the notebook with the business. + * + * BUSINESS_FULL_ACCESS: Deprecated. See the note above about BUSINESS_FULL_ACCESS and + * FULL_ACCESS being synonymous. + */ +enum SharedNotebookPrivilegeLevel { + READ_NOTEBOOK = 0, + MODIFY_NOTEBOOK_PLUS_ACTIVITY = 1, + READ_NOTEBOOK_PLUS_ACTIVITY = 2, + GROUP = 3, + FULL_ACCESS = 4, + BUSINESS_FULL_ACCESS = 5 +} + +/** + * Privilege levels for accessing a shared note. All privilege levels convey "activity feed" access, + * which allows the recipient to access information about other recipients and the activity stream. + * + * READ_NOTE: Recipient has rights to read the shared note. + * + * MODIFY_NOTE: Recipient has all of the rights of READ_NOTE, plus rights to modify the shared + * note's content, title and resources. Other fields, including the notebook, tags and metadata, + * may not be modified. + * + * FULL_ACCESS: Recipient has all of the rights of MODIFY_NOTE, plus rights to share the note with + * other users via email, public note links, and note sharing. Recipient may also update and + * remove other recipient's note sharing rights. + */ +enum SharedNotePrivilegeLevel { + READ_NOTE = 0, + MODIFY_NOTE = 1, + FULL_ACCESS = 2 +} + +/** + * Enumeration of the roles that a User can have within a sponsored group. + * + * GROUP_MEMBER: The user is a member of the group with no special privileges. + * + * GROUP_ADMIN: The user is an administrator within the group. + * + * GROUP_OWNER: The user is the owner of the group. + */ +enum SponsoredGroupRole { + GROUP_MEMBER = 1, + GROUP_ADMIN = 2, + GROUP_OWNER = 3 +} + +/** + * Enumeration of the roles that a User can have within an Evernote Business account. + * + * ADMIN: The user is an administrator of the Evernote Business account. + * + * NORMAL: The user is a regular user within the Evernote Business account. + */ +enum BusinessUserRole { + ADMIN = 1, + NORMAL = 2, +} + +/** + * The BusinessUserStatus indicates the status of the user in the business. + * + * A BusinessUser will typically start as ACTIVE. + * Only ACTIVE users can authenticate to the Business. + * + *
      + *
      ACTIVE
      + *
      The business user can authenticate to and access the business.
      + *
      DEACTIVATED
      + *
      The business user has been deactivated and cannot access the business
      + *
      + */ +enum BusinessUserStatus { + ACTIVE = 1, + DEACTIVATED = 2, +} + +/** + * An enumeration describing restrictions on the domain of shared notebook + * instances that are valid for a given operation, as used, for example, in + * NotebookRestrictions. + * + * ASSIGNED: The domain consists of shared notebooks that belong, or are assigned, + * to the recipient. + * + * NO_SHARED_NOTEBOOKS: No shared notebooks are applicable to the operation. + */ +enum SharedNotebookInstanceRestrictions { + /* + * originally had the name ONLY_JOINED_OR_PREVIEW and was renamed after the + * allowPreview feature was removed. + */ + ASSIGNED = 1, + + /* + * most restrictive + */ + NO_SHARED_NOTEBOOKS = 2 +} + +/** + * An enumeration describing the configuration state related to receiving + * reminder e-mails from the service. Reminder e-mails summarize notes + * based on their Note.attributes.reminderTime values. + * + * DO_NOT_SEND: The user has selected to not receive reminder e-mail. + * + * SEND_DAILY_EMAIL: The user has selected to receive reminder e-mail for those + * days when there is a reminder. + */ +enum ReminderEmailConfig { + DO_NOT_SEND = 1, + SEND_DAILY_EMAIL = 2 +} + +/** + * An enumeration defining the possible states of a BusinessInvitation. + * + * APPROVED: The invitation was created or approved by a business admin and may be redeemed by the + * invited email. + * + * REQUESTED: The invitation was requested by a non-admin member of the business and must be + * approved by an admin before it may be redeemed. Invitations in this state do not count + * against a business' seat limit. + * + * REDEEMED: The invitation has already been redeemed. Invitations in this state do not count + * against a business' seat limit. + */ +enum BusinessInvitationStatus { + APPROVED = 0, + REQUESTED = 1, + REDEEMED = 2 +} + +/** + * What kinds of Contacts does the Evernote service know about? + */ +enum ContactType { + EVERNOTE = 1, + SMS = 2, + FACEBOOK = 3, + EMAIL = 4, + TWITTER = 5, + LINKEDIN = 6, +} + +/** + * Entity types + */ +enum EntityType { + NOTE = 1, + NOTEBOOK = 2, + WORKSPACE = 3 +} + + +// ============================== Constants =================================== + +/** + * A value for the "recipe" key in the "classifications" map in NoteAttributes + * that indicates the user has classified a note as being a non-recipe. + */ +const string CLASSIFICATION_RECIPE_USER_NON_RECIPE = "000"; + +/** + * A value for the "recipe" key in the "classifications" map in NoteAttributes + * that indicates the user has classified a note as being a recipe. + */ +const string CLASSIFICATION_RECIPE_USER_RECIPE = "001"; + +/** + * A value for the "recipe" key in the "classifications" map in NoteAttributes + * that indicates the Evernote service has classified a note as being a recipe. + */ +const string CLASSIFICATION_RECIPE_SERVICE_RECIPE = "002"; + +/** + * Standardized value for the 'source' NoteAttribute for notes that + * were clipped from the web in some manner. + */ +const string EDAM_NOTE_SOURCE_WEB_CLIP = "web.clip"; + +/** + * Standardized value for the 'source' NoteAttribute for notes that + * were clipped using the "simplified article" function of the clipper. + */ +const string EDAM_NOTE_SOURCE_WEB_CLIP_SIMPLIFIED = "Clearly"; + +/** + * Standardized value for the 'source' NoteAttribute for notes that + * were clipped from an email message. + */ +const string EDAM_NOTE_SOURCE_MAIL_CLIP = "mail.clip"; + +/** + * Standardized value for the 'source' NoteAttribute for notes that + * were created via email sent to Evernote's email interface. + */ +const string EDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY = "mail.smtp"; + + +// ============================== Structures =================================== + +/** + * In several places, EDAM exchanges blocks of bytes of data for a component + * which may be relatively large. For example: the contents of a clipped + * HTML note, the bytes of an embedded image, or the recognition XML for + * a large image. This structure is used in the protocol to represent + * any of those large blocks of data when they are transmitted or when + * they are only referenced their metadata. + * + *
      + *
      bodyHash
      + *
      This field carries a one-way hash of the contents of the + * data body, in binary form. The hash function is MD5
      + * Length: EDAM_HASH_LEN (exactly) + *
      + * + *
      size
      + *
      The length, in bytes, of the data body. + *
      + * + *
      body
      + *
      This field is set to contain the binary contents of the data + * whenever the resource is being transferred. If only metadata is + * being exchanged, this field will be empty. For example, a client could + * notify the service about the change to an attribute for a resource + * without transmitting the binary resource contents. + *
      + *
      + */ +struct Data { + 1: optional binary bodyHash, + 2: optional i32 size, + 3: optional binary body +} + + +/** + * A structure holding the optional attributes that can be stored + * on a User. These are generally less critical than the core User fields. + * + *
      + *
      defaultLocationName
      + *
      the location string that should be associated + * with the user in order to determine where notes are taken if not otherwise + * specified.
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      defaultLatitude
      + *
      if set, this is the latitude that should be + * assigned to any notes that have no other latitude information. + *
      + * + *
      defaultLongitude
      + *
      if set, this is the longitude that should be + * assigned to any notes that have no other longitude information. + *
      + * + *
      preactivation
      + *
      if set, the user account is not yet confirmed for + * login. I.e. the account has been created, but we are still waiting for + * the user to complete the activation step. + *
      + * + *
      viewedPromotions
      + *
      a list of promotions the user has seen. + * This list may occasionally be modified by the system when promotions are + * no longer available.
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      incomingEmailAddress
      + *
      if set, this is the email address that the + * user may send email to in order to add an email note directly into the + * account via the SMTP email gateway. This is the part of the email + * address before the '@' symbol ... our domain is not included. + * If this is not set, the user may not add notes via the gateway.
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      recentMailedAddresses
      + *
      if set, this will contain a list of email + * addresses that have recently been used as recipients + * of outbound emails by the user. This can be used to pre-populate a + * list of possible destinations when a user wishes to send a note via + * email.
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX each
      + * Max: EDAM_USER_RECENT_MAILED_ADDRESSES_MAX entries + *
      + * + *
      comments
      + *
      Free-form text field that may hold general support + * information, etc.
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      dateAgreedToTermsOfService
      + *
      The date/time when the user agreed to + * the terms of service. This can be used as the effective "start date" + * for the account. + *
      + * + *
      maxReferrals
      + *
      The number of referrals that the user is permitted + * to make. + *
      + * + *
      referralCount
      + *
      The number of referrals sent from this account. + *
      + * + *
      refererCode
      + *
      A code indicating where the user was sent from. AKA + * promotion code + *
      + * + *
      sentEmailDate
      + *
      The most recent date when the user sent outbound + * emails from the service. Used with sentEmailCount to limit the number + * of emails that can be sent per day. + *
      + * + *
      sentEmailCount
      + *
      The number of emails that were sent from the user + * via the service on sentEmailDate. Used to enforce a limit on the number + * of emails per user per day to prevent spamming. + *
      + * + *
      dailyEmailLimit
      + *
      If set, this is the maximum number of emails that + * may be sent in a given day from this account. If unset, the server will + * use the configured default limit. + *
      + * + *
      emailOptOutDate
      + *
      If set, this is the date when the user asked + * to be excluded from offers and promotions sent by Evernote. If not set, + * then the user currently agrees to receive these messages. + *
      + * + *
      partnerEmailOptInDate
      + *
      If set, this is the date when the user asked + * to be included in offers and promotions sent by Evernote's partners. + * If not sent, then the user currently does not agree to receive these + * emails. + *
      + * + *
      preferredLanguage
      + *
      a 2 character language codes based on: + * http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt used for + * localization purposes to determine what language to use for the web + * interface and for other direct communication (e.g. emails). + *
      + * + *
      preferredCountry
      + *
      Preferred country code based on ISO 3166-1-alpha-2 indicating the + * users preferred country
      + * + *
      clipFullPage
      + *
      Boolean flag set to true if the user wants to clip full pages by + * default when they use the web clipper without a selection.
      + * + *
      twitterUserName
      + *
      The username of the account of someone who has chosen to enable + * Twittering into Evernote. This value is subject to change, since users + * may change their Twitter user name.
      + * + *
      twitterId
      + *
      The unique identifier of the user's Twitter account if that user + * has chosen to enable Twittering into Evernote.
      + * + *
      groupName
      + *
      A name identifier used to identify a particular set of branding and + * light customization.
      + * + *
      recognitionLanguage
      + *
      a 2 character language codes based on: + * http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt + * If set, this is used to determine the language that should be used + * when processing images and PDF files to find text. + * If not set, then the 'preferredLanguage' will be used. + *
      + * + *
      educationalInstitution
      + *
      a flag indicating that the user is part of an educational institution which + * makes them eligible for discounts on bulk purchases + *
      + * + *
      businessAddress
      + *
      A string recording the business address of a Sponsored Account user who has requested invoicing. + *
      + * + *
      hideSponsorBilling
      + *
      A flag indicating whether to hide the billing information on a sponsored + * account owner's settings page + *
      + * + *
      useEmailAutoFiling
      + *
      A flag indicating whether the user chooses to allow Evernote to automatically + * file and tag emailed notes + *
      + * + *
      reminderEmailConfig
      + *
      Configuration state for whether or not the user wishes to receive + * reminder e-mail. This setting applies to both the reminder e-mail sent + * for personal reminder notes and for the reminder e-mail sent for reminder + * notes in the user's business notebooks that the user has configured for + * e-mail notifications. + *
      + * + *
      emailAddressLastConfirmed
      + *
      If set, this contains the time at which the user last confirmed that the + * configured email address for this account is correct and up-to-date. If this is + * unset that indicates that the user's email address is unverified. + *
      + * + *
      passwordUpdated
      + *
      If set, this contains the time at which the user's password last changed. This + * will be unset for users created before the addition of this field who have not + * changed their passwords since the addition of this field. + *
      + * + *
      shouldLogClientEvent
      + *
      If set to True, the server will record LogRequest send from clients of this + * user as ClientEventLog. + *
      + * + *
      optOutMachineLearning
      + *
      If set to True, no Machine Learning nor human review will be done to this + * user's note contents. + *
      + *
      + */ +struct UserAttributes { + 1: optional string defaultLocationName, + 2: optional double defaultLatitude, + 3: optional double defaultLongitude, + 4: optional bool preactivation, + 5: optional list viewedPromotions, + 6: optional string incomingEmailAddress, + 7: optional list recentMailedAddresses, + 9: optional string comments, + 11: optional Timestamp dateAgreedToTermsOfService, + 12: optional i32 maxReferrals, + 13: optional i32 referralCount, + 14: optional string refererCode, + 15: optional Timestamp sentEmailDate, + 16: optional i32 sentEmailCount, + 17: optional i32 dailyEmailLimit, + 18: optional Timestamp emailOptOutDate, + 19: optional Timestamp partnerEmailOptInDate, + 20: optional string preferredLanguage, + 21: optional string preferredCountry, + 22: optional bool clipFullPage, + 23: optional string twitterUserName, + 24: optional string twitterId, + 25: optional string groupName, + 26: optional string recognitionLanguage, + 28: optional string referralProof, + 29: optional bool educationalDiscount, + 30: optional string businessAddress, + 31: optional bool hideSponsorBilling, + 33: optional bool useEmailAutoFiling, + 34: optional ReminderEmailConfig reminderEmailConfig, + 35: optional Timestamp emailAddressLastConfirmed, + 36: optional Timestamp passwordUpdated, + 37: optional bool salesforcePushEnabled, + 38: optional bool shouldLogClientEvent, + 39: optional bool optOutMachineLearning +} + +/** + * A structure holding the optional attributes associated with users + * in a business. + * + *
      + *
      title
      + *
      Free form text of this user's title in the business
      + * + *
      location
      + *
      City, State (for US) or City / Province for other countries
      + * + *
      department
      + *
      Free form text of the department this user belongs to.
      + * + *
      mobilePhone
      + *
      User's mobile phone number. Stored as plain text without any formatting.
      + * + *
      linkedInProfileUrl
      + *
      URL to user's public LinkedIn profile page. This should only contain + * the portion relative to the base LinkedIn URL. For example: "/pub/john-smith/". + *
      + * + *
      workPhone
      + *
      User's work phone number. Stored as plain text without any formatting.
      + * + *
      companyStartDate
      + *
      The date on which the user started working at their company.
      + *
      + */ +struct BusinessUserAttributes { + 1: optional string title, + 2: optional string location, + 3: optional string department, + 4: optional string mobilePhone, + 5: optional string linkedInProfileUrl, + 6: optional string workPhone, + 7: optional Timestamp companyStartDate +} + +/** + * This represents the bookkeeping information for the user's subscription. + * + *
      + *
      uploadLimitEnd
      + *
      The date and time when the current upload limit + * expires. At this time, the monthly upload count reverts to 0 and a new + * limit is imposed. This date and time is exclusive, so this is effectively + * the start of the new month. + *
      + *
      uploadLimitNextMonth
      + *
      When uploadLimitEnd is reached, the service + * will change uploadLimit to uploadLimitNextMonth. If a premium account is + * canceled, this mechanism will reset the quota appropriately. + *
      + *
      premiumServiceStatus
      + *
      Indicates the phases of a premium account + * during the billing process. + *
      + *
      premiumOrderNumber
      + *
      The order number used by the commerce system to + * process recurring payments + *
      + *
      premiumServiceStart
      + *
      The start date when this premium promotion + * began (this number will get overwritten if a premium service is canceled + * and then re-activated). + *
      + *
      premiumCommerceService
      + *
      The commerce system used (paypal, Google + * checkout, etc) + *
      + *
      premiumServiceSKU
      + *
      The code associated with the purchase eg. monthly + * or annual purchase. Clients should interpret this value and localize it. + *
      + *
      lastSuccessfulCharge
      + *
      Date the last time the user was charged. + * Null if never charged. + *
      + *
      lastFailedCharge
      + *
      Date the last time a charge was attempted and + * failed. + *
      + *
      lastFailedChargeReason
      + *
      Reason provided for the charge failure + *
      + *
      nextPaymentDue
      + *
      The end of the billing cycle. This could be in the + * past if there are failed charges. + *
      + *
      premiumLockUntil
      + *
      An internal variable to manage locking operations + * on the commerce variables. + *
      + *
      updated
      + *
      The date any modification where made to this record. + *
      + *
      premiumSubscriptionNumber
      + *
      The number number identifying the + * recurring subscription used to make the recurring charges. + *
      + *
      lastRequestedCharge
      + *
      Date charge last attempted
      + *
      currency
      + *
      ISO 4217 currency code
      + *
      unitPrice
      + *
      charge in the smallest unit of the currency (e.g. cents for USD)
      + *
      businessId
      + *
      DEPRECATED:See BusinessUserInfo.
      + *
      businessName
      + *
      DEPRECATED:See BusinessUserInfo.
      + *
      businessRole
      + *
      DEPRECATED:See BusinessUserInfo.
      + *
      unitDiscount
      + *
      discount per seat in negative amount and smallest unit of the currency (e.g. + * cents for USD)
      + *
      nextChargeDate
      + *
      The next time the user will be charged, may or may not be the same as + * nextPaymentDue
      + *
      + */ +struct Accounting { + 2: optional Timestamp uploadLimitEnd, + 3: optional i64 uploadLimitNextMonth, + 4: optional PremiumOrderStatus premiumServiceStatus, + 5: optional string premiumOrderNumber, + 6: optional string premiumCommerceService, + 7: optional Timestamp premiumServiceStart, + 8: optional string premiumServiceSKU, + 9: optional Timestamp lastSuccessfulCharge, + 10: optional Timestamp lastFailedCharge, + 11: optional string lastFailedChargeReason, + 12: optional Timestamp nextPaymentDue, + 13: optional Timestamp premiumLockUntil, + 14: optional Timestamp updated, + 16: optional string premiumSubscriptionNumber, + 17: optional Timestamp lastRequestedCharge, + 18: optional string currency, + 19: optional i32 unitPrice, + 20: optional i32 businessId, + 21: optional string businessName, + 22: optional BusinessUserRole businessRole, + 23: optional i32 unitDiscount, + 24: optional Timestamp nextChargeDate, + 25: optional i32 availablePoints +} + +/** + * This structure is used to provide information about an Evernote Business + * membership, for members who are part of a business. + * + *
      + *
      businessId
      + *
      The ID of the Evernote Business account that the user is a member of. + *
      businessName
      + *
      The human-readable name of the Evernote Business account that the user + * is a member of.
      + *
      role
      + *
      The role of the user within the Evernote Business account that + * they are a member of.
      + *
      email
      + *
      An e-mail address that will be used by the service in the context of your + * Evernote Business activities. For example, this e-mail address will be used + * when you e-mail a business note, when you update notes in the account of + * your business, etc. The business e-mail cannot be used for identification + * purposes such as for logging into the service. + *
      + *
      updated
      + *
      Last time the business user or business user attributes were updated.
      + *
      + */ +struct BusinessUserInfo { + 1: optional i32 businessId, + 2: optional string businessName, + 3: optional BusinessUserRole role, + 4: optional string email, + 5: optional Timestamp updated +} + +/** + * This structure is used to provide account limits that are in effect for this user. + *
      + *
      userMailLimitDaily
      + *
      The number of emails of any type that can be sent by a user from the + * service per day. If an email is sent to two different recipients, this + * counts as two emails. + *
      + *
      noteSizeMax
      + *
      Maximum total size of a Note that can be added. The size of a note is + * calculated as: + * ENML content length (in Unicode characters) plus the sum of all resource + * sizes (in bytes). + *
      + *
      resourceSizeMax
      + *
      Maximum size of a resource, in bytes + *
      + *
      userLinkedNotebookMax
      + *
      Maximum number of linked notebooks per account. + *
      + *
      uploadLimit
      + *
      The number of bytes that can be uploaded to the account + * in the current month. For new notes that are created, this is the length + * of the note content (in Unicode characters) plus the size of each resource + * (in bytes). For edited notes, this is the the difference between the old + * length and the new length (if this is greater than 0) plus the size of + * each new resource. + *
      + *
      userNoteCountMax
      + *
      Maximum number of Notes per user
      + *
      userNotebookCountMax
      + *
      Maximum number of Notebooks per user
      + *
      userTagCountMax
      + *
      Maximum number of Tags per account
      + *
      noteTagCountMax
      + *
      Maximum number of Tags per Note
      + *
      userSavedSearchesMax
      + *
      Maximum number of SavedSearches per account
      + *
      noteResourceCountMax
      + *
      The maximum number of Resources per Note
      + *
      + */ +struct AccountLimits { + 1: optional i32 userMailLimitDaily, + 2: optional i64 noteSizeMax, + 3: optional i64 resourceSizeMax, + 4: optional i32 userLinkedNotebookMax, + 5: optional i64 uploadLimit, + 6: optional i32 userNoteCountMax, + 7: optional i32 userNotebookCountMax, + 8: optional i32 userTagCountMax, + 9: optional i32 noteTagCountMax, + 10: optional i32 userSavedSearchesMax, + 11: optional i32 noteResourceCountMax +} + +/** + * This represents the information about a single user account. + *
      + *
      id
      + *
      The unique numeric identifier for the account, which will not + * change for the lifetime of the account. + *
      + * + *
      username
      + *
      The name that uniquely identifies a single user account. This name + * may be presented by the user, along with their password, to log into + * their account. + * May only contain a-z, 0-9, or '-', and may not start or end with the '-' + *
      + * Length: EDAM_USER_USERNAME_LEN_MIN - EDAM_USER_USERNAME_LEN_MAX + *
      + * Regex: EDAM_USER_USERNAME_REGEX + *
      + * + *
      email
      + *
      The email address registered for the user. Must comply with + * RFC 2821 and RFC 2822.
      + * Third party applications that authenticate using OAuth do not have + * access to this field. + * Length: EDAM_EMAIL_LEN_MIN - EDAM_EMAIL_LEN_MAX + *
      + * Regex: EDAM_EMAIL_REGEX + *
      + * + *
      name
      + *
      The printable name of the user, which may be a combination + * of given and family names. This is used instead of separate "first" + * and "last" names due to variations in international name format/order. + * May not start or end with a whitespace character. May contain any + * character but carriage return or newline (Unicode classes Zl and Zp). + *
      + * Length: EDAM_USER_NAME_LEN_MIN - EDAM_USER_NAME_LEN_MAX + *
      + * Regex: EDAM_USER_NAME_REGEX + *
      + * + *
      timezone
      + *
      The zone ID for the user's default location. If present, + * this may be used to localize the display of any timestamp for which no + * other timezone is available. + * The format must be encoded as a standard zone ID such as + * "America/Los_Angeles" or "GMT+08:00" + *
      + * Length: EDAM_TIMEZONE_LEN_MIN - EDAM_TIMEZONE_LEN_MAX + *
      + * Regex: EDAM_TIMEZONE_REGEX + *
      + * + *
      serviceLevel
      + *
      The level of service the user currently receives. This will always be populated + * for users retrieved from the Evernote service. + *
      + * + *
      created
      + *
      The date and time when this user account was created in the + * service. + *
      + * + *
      updated
      + *
      The date and time when this user account was last modified + * in the service. + *
      + * + *
      deleted
      + *
      If the account has been deleted from the system (e.g. as + * the result of a legal request by the user), the date and time of the + * deletion will be represented here. If not, this value will not be set. + *
      + * + *
      active
      + *
      If the user account is available for login and + * synchronization, this flag will be set to true. + *
      + * + *
      shardId
      + *
      DEPRECATED - Client applications should have no need to use this field. + *
      + * + *
      attributes
      + *
      If present, this will contain a list of the attributes + * for this user account. + *
      + * + *
      accounting
      + *
      Bookkeeping information for the user's subscription. + *
      + * + *
      businessUserInfo
      + *
      If present, this will contain a set of business information + * relating to the user's business membership. If not present, the + * user is not currently part of a business. + *
      + * + *
      photoUrl
      + *
      The URL of the photo that represents this User. This field is filled in by the + * service and is read-only to clients. If photoLastUpdated is + * not set, this url will point to a placeholder user photo generated by the + * service.
      + * + *
      photoLastUpdated
      + *
      The time at which the photo at 'photoUrl' was last updated by this User. This + * field will be null if the User never set a profile photo. This field is filled in by + * the service and is read-only to clients.
      + * + *
      accountLimits
      + *
      Account limits applicable for this user.
      + */ +struct User { + 1: optional UserID id, + 2: optional string username, + 3: optional string email, + 4: optional string name, + 6: optional string timezone, + 7: optional PrivilegeLevel privilege, + 21: optional ServiceLevel serviceLevel, + 9: optional Timestamp created, + 10: optional Timestamp updated, + 11: optional Timestamp deleted, + 13: optional bool active, + 14: optional string shardId, + 15: optional UserAttributes attributes, + 16: optional Accounting accounting, + 18: optional BusinessUserInfo businessUserInfo, + 19: optional string photoUrl, + 20: optional Timestamp photoLastUpdated, + 22: optional AccountLimits accountLimits +} + + +/** + * A structure that represents contact information. Note this does not necessarily correspond to + * an Evernote user. + * + *
      + *
      name
      + *
      The displayable name of this contact. This field is filled in by the service and + * is read-only to clients. + *
      + *
      id
      + *
      A unique identifier for this ContactType. + *
      + *
      type
      + *
      What service does this contact come from? + *
      + *
      photoUrl
      + *
      A URL of a profile photo representing this Contact. This field is filled in by the + * service and is read-only to clients. + *
      + *
      photoLastUpdated
      + *
      timestamp when the profile photo at 'photoUrl' was last updated. + * This field will be null if the user has never set a profile photo. + * This field is filled in by the service and is read-only to clients. + *
      + *
      messagingPermit
      + *
      This field will only be filled by the service when it is giving a Contact record + * to a client, and that client does not normally have enough permission to send a + * new message to the person represented through this Contact. In that case, this + * whole Contact record could be used to send a new Message to the Contact, and the + * service will inspect this permit to confirm that operation was allowed. + *
      + *
      messagingPermitExpires
      + *
      If this field is set, then this (whole) Contact record may be used in calls to + * sendMessage until this time. After that time, those calls may be rejected by the + * service if the caller does not have direct permission to initiate a message with + * the represented Evernote user. + *
      + *
      + */ +struct Contact { + 1: optional string name, + 2: optional string id, + 3: optional ContactType type, + 4: optional string photoUrl, + 5: optional Timestamp photoLastUpdated, + 6: optional binary messagingPermit, + 7: optional Timestamp messagingPermitExpires +} + +/** + * An object that represents the relationship between a Contact that possibly + * belongs to an Evernote User. + * + *
      + *
      id
      + *
      The unique identifier for this mapping. + *
      + * + *
      contact
      + *
      The Contact that can be used to address this Identity. May be unset. + *
      + * + *
      userId
      + *
      The Evernote User id that is connected to the Contact. May be unset + * if this identity has not yet been claimed, or the caller is not + * connected to this identity. + *
      + * + *
      deactivated
      + *
      Indicates that the contact for this identity is no longer active and + * should not be used when creating new threads using Destination.recipients, + * unless you know of another Identity instance with the same contact information + * that is active. If you are connected to the user (see userConnected), you + * can still create threads using their Evernote-type contact.
      + * + *
      sameBusiness
      + *
      Does this Identity belong to someone who is in the same business as the + * caller? + *
      + * + *
      blocked
      + *
      Has the caller blocked the Evernote user this Identity represents? + *
      + * + *
      userConnected
      + *
      Indicates that the caller is "connected" to the user of this + * identity via this identity. When you have a connection via an + * identity, you should always create new threads using the + * Evernote-type contact (see ContactType) using the userId field + * from a connected Identity. On the Evernote service, the + * Evernote-type contact is the most durable. Phone numbers and + * e-mail addresses can get re-assigned but your Evernote account + * user ID will remain the same. A connection exists when both of + * you are in the same business or the user has replied to a thread + * that you are on. When connected, you will also get to see more + * information about the user who has claimed the identity. Note + * that you are never connected to yourself since you won't be + * sending messages to yourself, but you will obviously see your own + * profile information. + *
      + * + *
      eventId
      + *
      A server-assigned sequence number for the events in the messages + * subsystem. + *
      + *
      + */ +struct Identity { + 1: required IdentityID id, + 2: optional Contact contact, + 3: optional UserID userId, + 4: optional bool deactivated, + 5: optional bool sameBusiness, + 6: optional bool blocked, + 7: optional bool userConnected, + 8: optional MessageEventID eventId +} + +/** + * A tag within a user's account is a unique name which may be organized + * a simple hierarchy. + *
      + *
      guid
      + *
      The unique identifier of this tag. Will be set by the service, + * so may be omitted by the client when creating the Tag. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      name
      + *
      A sequence of characters representing the tag's identifier. + * Case is preserved, but is ignored for comparisons. + * This means that an account may only have one tag with a given name, via + * case-insensitive comparison, so an account may not have both "food" and + * "Food" tags. + * May not contain a comma (','), and may not begin or end with a space. + *
      + * Length: EDAM_TAG_NAME_LEN_MIN - EDAM_TAG_NAME_LEN_MAX + *
      + * Regex: EDAM_TAG_NAME_REGEX + *
      + * + *
      parentGuid
      + *
      If this is set, then this is the GUID of the tag that + * holds this tag within the tag organizational hierarchy. If this is + * not set, then the tag has no parent and it is a "top level" tag. + * Cycles are not allowed (e.g. a->parent->parent == a) and will be + * rejected by the service. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      updateSequenceNum
      + *
      A number identifying the last transaction to + * modify the state of this object. The USN values are sequential within an + * account, and can be used to compare the order of modifications within the + * service. + *
      + *
      + */ +struct Tag { + 1: optional Guid guid, + 2: optional string name, + 3: optional Guid parentGuid, + 4: optional i32 updateSequenceNum +} + + +/** + * A structure that wraps a map of name/value pairs whose values are not + * always present in the structure in order to reduce space when obtaining + * batches of entities that contain the map. + * + * When the server provides the client with a LazyMap, it will fill in either + * the keysOnly field or the fullMap field, but never both, based on the API + * and parameters. + * + * When a client provides a LazyMap to the server as part of an update to + * an object, the server will only update the LazyMap if the fullMap field is + * set. If the fullMap field is not set, the server will not make any changes + * to the map. + * + * Check the API documentation of the individual calls involving the LazyMap + * for full details including the constraints of the names and values of the + * map. + * + *
      + *
      keysOnly
      + *
      The set of keys for the map. This field is ignored by the + * server when set. + *
      + * + *
      fullMap
      + *
      The complete map, including all keys and values. + *
      + *
      + */ +struct LazyMap { + 1: optional set keysOnly, + 2: optional map fullMap +} + + +/** + * Structure holding the optional attributes of a Resource + *
      + *
      sourceURL
      + *
      the original location where the resource was hosted + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      timestamp
      + *
      the date and time that is associated with this resource + * (e.g. the time embedded in an image from a digital camera with a clock) + *
      + * + *
      latitude
      + *
      the latitude where the resource was captured + *
      + * + *
      longitude
      + *
      the longitude where the resource was captured + *
      + * + *
      altitude
      + *
      the altitude where the resource was captured + *
      + * + *
      cameraMake
      + *
      information about an image's camera, e.g. as embedded in + * the image's EXIF data + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      cameraModel
      + *
      information about an image's camera, e.g. as embedded + * in the image's EXIF data + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      clientWillIndex
      + *
      if true, then the original client that submitted + * the resource plans to submit the recognition index for this resource at a + * later time. + *
      + * + *
      recoType
      + *
      DEPRECATED - this field is no longer set by the service, so should + * be ignored. + *
      + * + *
      fileName
      + *
      if the resource came from a source that provided an + * explicit file name, the original name will be stored here. Many resources + * come from unnamed sources, so this will not always be set. + *
      + * + *
      attachment
      + *
      this will be true if the resource should be displayed as an attachment, + * or false if the resource should be displayed inline (if possible). + *
      + * + *
      applicationData
      + *
      Provides a location for applications to store a relatively small + * (4kb) blob of data associated with a Resource that is not visible to the user + * and that is opaque to the Evernote service. A single application may use at most + * one entry in this map, using its API consumer key as the map key. See the + * documentation for LazyMap for a description of when the actual map values + * are returned by the service. + *

      To safely add or modify your application's entry in the map, use + * NoteStore.setResourceApplicationDataEntry. To safely remove your application's + * entry from the map, use NoteStore.unsetResourceApplicationDataEntry.

      + * Minimum length of a name (key): EDAM_APPLICATIONDATA_NAME_LEN_MIN + *
      + * Sum max size of key and value: EDAM_APPLICATIONDATA_ENTRY_LEN_MAX + *
      + * Syntax regex for name (key): EDAM_APPLICATIONDATA_NAME_REGEX + *
      + * + *
      + */ +struct ResourceAttributes { + 1: optional string sourceURL, + 2: optional Timestamp timestamp, + 3: optional double latitude, + 4: optional double longitude, + 5: optional double altitude, + 6: optional string cameraMake, + 7: optional string cameraModel, + 8: optional bool clientWillIndex, + 9: optional string recoType, + 10: optional string fileName, + 11: optional bool attachment, + 12: optional LazyMap applicationData +} + + +/** + * Every media file that is embedded or attached to a note is represented + * through a Resource entry. + *
      + *
      guid
      + *
      The unique identifier of this resource. Will be set whenever + * a resource is retrieved from the service, but may be null when a client + * is creating a resource. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      noteGuid
      + *
      The unique identifier of the Note that holds this + * Resource. Will be set whenever the resource is retrieved from the service, + * but may be null when a client is creating a resource. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      data
      + *
      The contents of the resource. + * Maximum length: The data.body is limited to EDAM_RESOURCE_SIZE_MAX_FREE + * for free accounts and EDAM_RESOURCE_SIZE_MAX_PREMIUM for premium accounts. + *
      + * + *
      mime
      + *
      The MIME type for the embedded resource. E.g. "image/gif" + *
      + * Length: EDAM_MIME_LEN_MIN - EDAM_MIME_LEN_MAX + *
      + * Regex: EDAM_MIME_REGEX + *
      + * + *
      width
      + *
      If set, this contains the display width of this resource, in + * pixels. + *
      + * + *
      height
      + *
      If set, this contains the display height of this resource, + * in pixels. + *
      + * + *
      duration
      + *
      DEPRECATED: ignored. + *
      + * + *
      active
      + *
      If the resource is active or not. + *
      + * + *
      recognition
      + *
      If set, this will hold the encoded data that provides + * information on search and recognition within this resource. + *
      + * + *
      attributes
      + *
      A list of the attributes for this resource. + *
      + * + *
      updateSequenceNum
      + *
      A number identifying the last transaction to + * modify the state of this object. The USN values are sequential within an + * account, and can be used to compare the order of modifications within the + * service. + *
      + * + *
      alternateData
      + *
      Some Resources may be assigned an alternate data format by the service + * which may be more appropriate for indexing or rendering than the original + * data provided by the user. In these cases, the alternate data form will + * be available via this Data element. If a Resource has no alternate form, + * this field will be unset.
      + *
      + */ +struct Resource { + 1: optional Guid guid, + 2: optional Guid noteGuid, + 3: optional Data data, + 4: optional string mime, + 5: optional i16 width, + 6: optional i16 height, + 7: optional i16 duration, + 8: optional bool active, + 9: optional Data recognition, + 11: optional ResourceAttributes attributes, + 12: optional i32 updateSequenceNum, + 13: optional Data alternateData +} + + +/** + * The list of optional attributes that can be stored on a note. + *
      + *
      subjectDate
      + *
      time that the note refers to + *
      + * + *
      latitude
      + *
      the latitude where the note was taken + *
      + * + *
      longitude
      + *
      the longitude where the note was taken + *
      + * + *
      altitude
      + *
      the altitude where the note was taken + *
      + * + *
      author
      + *
      the author of the content of the note + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      source
      + *
      the method that the note was added to the account, if the + * note wasn't directly authored in an Evernote desktop client. + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      sourceURL
      + *
      the original location where the resource was hosted. For web clips, + * this will be the URL of the page that was clipped. + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      sourceApplication
      + *
      an identifying string for the application that + * created this note. This string does not have a guaranteed syntax or + * structure -- it is intended for human inspection and tracking. + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      shareDate
      + *
      The date and time when this note was directly shared via its own URL. + * This is only set on notes that were individually shared - it is independent + * of any notebook-level sharing of the containing notebook. This field + * is treated as "read-only" for clients; the server will ignore changes + * to this field from an external client. + *
      + * + *
      reminderOrder
      + *
      The set of notes with this parameter set are considered + * "reminders" and are to be treated specially by clients to give them + * higher UI prominence within a notebook. The value is used to sort + * the reminder notes within the notebook with higher values + * representing greater prominence. Outside of the context of a + * notebook, the value of this parameter is undefined. The value is + * not intended to be compared to the values of reminder notes in + * other notebooks. In order to allow clients to place a note at a + * higher precedence than other notes, you should never set a value + * greater than the current time (as defined for a Timetstamp). To + * place a note at higher precedence than existing notes, set the + * value to the current time as defined for a timestamp (milliseconds + * since the epoch). Synchronizing clients must remember the time when + * the update was performed, using the local clock on the client, + * and use that value when they later upload the note to the service. + * Clients must not set the reminderOrder to the reminderTime as the + * reminderTime could be in the future. Those two fields are never + * intended to be related. The correct value for reminderOrder field + * for new notes is the "current" time when the user indicated that + * the note is a reminder. Clients may implement a separate + * "sort by date" feature to show notes ordered by reminderTime. + * Whenever a reminderDoneTime or reminderTime is set but a + * reminderOrder is not set, the server will fill in the current + * server time for the reminderOrder field.
      + * + *
      reminderDoneTime
      + *
      The date and time when a user dismissed/"marked done" the reminder + * on the note. Users typically do not manually set this value directly + * as it is set to the time when the user dismissed/"marked done" the + * reminder.
      + * + *
      reminderTime
      + *
      The date and time a user has selected to be reminded of the note. + * A note with this value set is known as a "reminder" and the user can + * be reminded, via e-mail or client-specific notifications, of the note + * when the time is reached or about to be reached. When a user sets + * a reminder time on a note that has a reminder done time, and that + * reminder time is in the future, then the reminder done time should be + * cleared. This should happen regardless of any existing reminder time + * that may have previously existed on the note.
      + * + *
      placeName
      + *
      Allows the user to assign a human-readable location name associated + * with a note. Users may assign values like 'Home' and 'Work'. Place + * names may also be populated with values from geonames database + * (e.g., a restaurant name). Applications are encouraged to normalize values + * so that grouping values by place name provides a useful result. Applications + * MUST NOT automatically add place name values based on geolocation without + * confirmation from the user; that is, the value in this field should be + * more useful than a simple automated lookup based on the note's latitude + * and longitude.
      + * + *
      contentClass
      + *
      The class (or type) of note. This field is used to indicate to + * clients that special structured information is represented within + * the note such that special rules apply when making + * modifications. If contentClass is set and the client + * application does not specifically support the specified class, + * the client MUST treat the note as read-only. In this case, the + * client MAY modify the note's notebook and tags via the + * Note.notebookGuid and Note.tagGuids fields. The client MAY also + * modify the reminderOrder field as well as the reminderTime and + * reminderDoneTime fields. + *

      Applications should set contentClass only when they are creating notes + * that contain structured information that needs to be maintained in order + * for the user to be able to use the note within that application. + * Setting contentClass makes a note read-only in other applications, so + * there is a trade-off when an application chooses to use contentClass. + * Applications that set contentClass when creating notes must use a contentClass + * string of the form CompanyName.ApplicationName to ensure uniqueness.

      + * Length restrictions: EDAM_NOTE_CONTENT_CLASS_LEN_MIN, EDAM_NOTE_CONTENT_CLASS_LEN_MAX + *
      + * Regex: EDAM_NOTE_CONTENT_CLASS_REGEX + *
      + * + *
      applicationData
      + *
      Provides a location for applications to store a relatively small + * (4kb) blob of data that is not meant to be visible to the user and + * that is opaque to the Evernote service. A single application may use at most + * one entry in this map, using its API consumer key as the map key. See the + * documentation for LazyMap for a description of when the actual map values + * are returned by the service. + *

      To safely add or modify your application's entry in the map, use + * NoteStore.setNoteApplicationDataEntry. To safely remove your application's + * entry from the map, use NoteStore.unsetNoteApplicationDataEntry.

      + * Minimum length of a name (key): EDAM_APPLICATIONDATA_NAME_LEN_MIN + *
      + * Sum max size of key and value: EDAM_APPLICATIONDATA_ENTRY_LEN_MAX + *
      + * Syntax regex for name (key): EDAM_APPLICATIONDATA_NAME_REGEX + *
      + * + *
      creatorId
      + *
      The numeric user ID of the user who originally created the note.
      + * + *
      lastEditedBy
      + *
      An indication of who made the last change to the note. If you are + * accessing the note via a shared notebook to which you have modification + * rights, or if you are the owner of the notebook to which the note belongs, + * then you have access to the value. In this case, the value will be + * unset if the owner of the notebook containing the note was the last to + * make the modification, else it will be a string describing the + * guest who made the last edit. If you do not have access to this value, + * it will be left unset. This field is read-only by clients. The server + * will ignore all values set by clients into this field.
      + * + *
      lastEditorId
      + *
      The numeric user ID of the user described in lastEditedBy.
      + * + *
      classifications
      + *
      A map of classifications applied to the note by clients or by the + * Evernote service. The key is the string name of the classification type, + * and the value is a constant that begins with CLASSIFICATION_.
      + * + *
      sharedWithBusiness
      + *
      When this flag is set on a business note, any user in that business + * may view the note if they request it by GUID. This field is read-only by + * clients. The server will ignore all values set by clients into this field. + * + * To share a note with the business, use NoteStore.shareNoteWithBusiness and + * to stop sharing a note with the business, use NoteStore.stopSharingNoteWithBusiness. + *
      + * + *
      conflictSourceNoteGuid
      + *
      If set, this specifies the GUID of a note that caused a sync conflict + * resulting in the creation of a duplicate note. The duplicated note contains + * the user's changes that could not be applied as a result of the sync conflict, + * and uses the conflictSourceNoteGuid field to specify the note that caused the + * conflict. This allows clients to provide a customized user experience for note + * conflicts. + *
      + * + *
      noteTitleQuality
      + *
      If set, this specifies that the note's title was automatically generated + * and indicates the likelihood that the generated title is useful for display to + * the user. If not set, the note's title was manually entered by the user. + * + * Clients MUST set this attribute to one of the following values when the + * corresponding note's title was not manually entered by the user: + * EDAM_NOTE_TITLE_QUALITY_UNTITLED, EDAM_NOTE_TITLE_QUALITY_LOW, + * EDAM_NOTE_TITLE_QUALITY_MEDIUM or EDAM_NOTE_TITLE_QUALITY_HIGH. + * + * When a user edits a note's title, clients MUST unset this value. + *
      + *
      + */ +struct NoteAttributes { + 1: optional Timestamp subjectDate, + 10: optional double latitude, + 11: optional double longitude, + 12: optional double altitude, + 13: optional string author, + 14: optional string source, + 15: optional string sourceURL, + 16: optional string sourceApplication, + 17: optional Timestamp shareDate, + 18: optional i64 reminderOrder, + 19: optional Timestamp reminderDoneTime, + 20: optional Timestamp reminderTime, + 21: optional string placeName, + 22: optional string contentClass, + 23: optional LazyMap applicationData, + 24: optional string lastEditedBy, + 26: optional map classifications, + 27: optional UserID creatorId, + 28: optional UserID lastEditorId, + 29: optional bool sharedWithBusiness, + 30: optional Guid conflictSourceNoteGuid, + 31: optional i32 noteTitleQuality +} + + +/** + * Represents a relationship between a note and a single share invitation recipient. The recipient + * is identified via an Identity, and has a given privilege that specifies what actions they may + * take on the note. + * + *
      + *
      sharerUserID
      + *
      The user ID of the user who shared the note with the recipient.
      + * + *
      recipientIdentity
      + *
      The identity of the recipient of the share. For a given note, there may be only one + * SharedNote per recipient identity. Only recipientIdentity.id is guaranteed to be set. + * Other fields on the Identity may or my not be set based on the requesting user's + * relationship with the recipient.
      + * + *
      privilege
      + *
      The privilege level that the share grants to the recipient.
      + * + *
      serviceCreated
      + *
      The time at which the share was created.
      + * + *
      serviceUpdated
      + *
      The time at which the share was last updated.
      + * + *
      serviceAssigned
      + *
      The time at which the share was assigned to a specific recipient user ID.
      + *
      + */ +struct SharedNote { + 1: optional UserID sharerUserID, + 2: optional Identity recipientIdentity, + 3: optional SharedNotePrivilegeLevel privilege, + 4: optional Timestamp serviceCreated, + 5: optional Timestamp serviceUpdated, + 6: optional Timestamp serviceAssigned +} + +/** + * This structure captures information about the operations that cannot be performed on a given + * note that has been shared with a recipient via a SharedNote. The following operations are + * never allowed based on SharedNotes, and as such are left out of the NoteRestrictions + * structure for brevity: + * + *
        + *
      • Expunging a note (NoteStore.expungeNote)
      • + *
      • Moving a note to the trash (Note.active)
      • + *
      • Updating a note's notebook (Note.notebookGuid)
      • + *
      • Updating a note's tags (Note.tagGuids, Note.tagNames)
      • + *
      • Updating a note's attributes (Note.attributes)
      • + *
      • Sharing a note with the business (NoteStore.shareNoteWithBusiness
      • + *
      • Getting a note's version history (NoteStore.listNoteVersions, + * NoteStore.getNoteVersion)
      • + *
      + * + * When a client has permission to update a note's title or content, it may also update the + * Note.updated timestamp. + * + * This structure reflects only the privileges / restrictions conveyed by the SharedNote. + * It does not incorporate privileges conveyed by a potential SharedNotebook to the same + * recipient. As such, the actual permissions that the recipient has on the note may differ from + * the permissions expressed in this structure. + * + * For example, consider a user with read-only access to a shared notebook, and a read-write share + * of a specific note in the notebook. The note restrictions would contain noUpdateTitle = false, + * while the notebook restrictions would contain noUpdateNotes = true. In this case, the user is + * allowed to update the note title based on the note restrictions. + * + * Alternatively, consider a user with read-write access to a shared notebook, and a read-only + * share of a specific note in that notebook. The note restrictions would contain + * noUpdateTitle = true, while the notebook restrictions would contain noUpdateNotes = false. In + * this case, the user would have full edit permissions on the note based on the notebook + * restrictions. + * + *
      + *
      noUpdateTitle
      + *
      The client may not update the note's title (Note.title).
      + * + *
      noUpdateContent
      + *
      The client may not update the note's content. Content includes Note.content + * and Note.resources, as well as the related fields Note.contentHash and + * Note.contentLength.
      + * + *
      noEmail
      + *
      The client may not email the note (NoteStore.emailNote).
      + * + *
      noShare
      + *
      The client may not share the note with specific recipients + * (NoteStore.createOrUpdateSharedNotes).
      + * + *
      noSharePublicly
      + *
      The client may not make the note public (NoteStore.shareNote).
      + *
      + */ +struct NoteRestrictions { + 1: optional bool noUpdateTitle, + 2: optional bool noUpdateContent, + 3: optional bool noEmail, + 4: optional bool noShare, + 5: optional bool noSharePublicly +} + +/** + * Represents the owner's account related limits on a Note. + * The field uploaded represents the total number of bytes that have been uploaded + * to this account and is taken from the SyncState struct. All other fields + * represent account related limits and are taken from the AccountLimits struct. + *

      + * See SyncState and AccountLimits struct field definitions for more details. + */ +struct NoteLimits { + 1: optional i32 noteResourceCountMax, + 2: optional i64 uploadLimit, + 3: optional i64 resourceSizeMax, + 4: optional i64 noteSizeMax, + 5: optional i64 uploaded +} + +/** + * Represents a single note in the user's account. + * + *

      + *
      guid
      + *
      The unique identifier of this note. Will be set by the + * server, but will be omitted by clients calling NoteStore.createNote() + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      title
      + *
      The subject of the note. Can't begin or end with a space. + *
      + * Length: EDAM_NOTE_TITLE_LEN_MIN - EDAM_NOTE_TITLE_LEN_MAX + *
      + * Regex: EDAM_NOTE_TITLE_REGEX + *
      + * + *
      content
      + *
      The XHTML block that makes up the note. This is + * the canonical form of the note's contents, so will include abstract + * Evernote tags for internal resource references. A client may create + * a separate transformed version of this content for internal presentation, + * but the same canonical bytes should be used for transmission and + * comparison unless the user chooses to modify their content. + *
      + * Length: EDAM_NOTE_CONTENT_LEN_MIN - EDAM_NOTE_CONTENT_LEN_MAX + *
      + * + *
      contentHash
      + *
      The binary MD5 checksum of the UTF-8 encoded content + * body. This will always be set by the server, but clients may choose to omit + * this when they submit a note with content. + *
      + * Length: EDAM_HASH_LEN (exactly) + *
      + * + *
      contentLength
      + *
      The number of Unicode characters in the content of + * the note. This will always be set by the service, but clients may choose + * to omit this value when they submit a Note. + *
      + * + *
      created
      + *
      The date and time when the note was created in one of the + * clients. In most cases, this will match the user's sense of when + * the note was created, and ordering between notes will be based on + * ordering of this field. However, this is not a "reliable" timestamp + * if a client has an incorrect clock, so it cannot provide a true absolute + * ordering between notes. Notes created directly through the service + * (e.g. via the web GUI) will have an absolutely ordered "created" value. + *
      + * + *
      updated
      + *
      The date and time when the note was last modified in one of + * the clients. In most cases, this will match the user's sense of when + * the note was modified, but this field may not be absolutely reliable + * due to the possibility of client clock errors. + *
      + * + *
      deleted
      + *
      If present, the note is considered "deleted", and this + * stores the date and time when the note was deleted by one of the clients. + * In most cases, this will match the user's sense of when the note was + * deleted, but this field may be unreliable due to the possibility of + * client clock errors. + *
      + * + *
      active
      + *
      If the note is available for normal actions and viewing, + * this flag will be set to true. + *
      + * + *
      updateSequenceNum
      + *
      A number identifying the last transaction to + * modify the state of this note (including changes to the note's attributes + * or resources). The USN values are sequential within an account, + * and can be used to compare the order of modifications within the service. + *
      + * + *
      notebookGuid
      + *
      The unique identifier of the notebook that contains + * this note. If no notebookGuid is provided on a call to createNote(), the + * default notebook will be used instead. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      tagGuids
      + *
      A list of the GUID identifiers for tags that are applied to this note. + * This may be provided in a call to createNote() to unambiguously declare + * the tags that should be assigned to the new note. Alternately, clients + * may pass the names of desired tags via the 'tagNames' field during + * note creation. + * If the list of tags are omitted on a call to createNote(), then + * the server will assume that no changes have been made to the resources. + * Maximum: EDAM_NOTE_TAGS_MAX tags per note + *
      + * + *
      resources
      + *
      The list of resources that are embedded within this note. + * If the list of resources are omitted on a call to updateNote(), then + * the server will assume that no changes have been made to the resources. + * The binary contents of the resources must be provided when the resource + * is first sent to the service, but it will be omitted by the service when + * the Note is returned in the future. + * Maximum: EDAM_NOTE_RESOURCES_MAX resources per note + *
      + * + *
      attributes
      + *
      A list of the attributes for this note. + * If the list of attributes are omitted on a call to updateNote(), then + * the server will assume that no changes have been made to the resources. + *
      + * + *
      tagNames
      + *
      May be provided by clients during calls to createNote() as an + * alternative to providing the tagGuids of existing tags. If any tagNames + * are provided during createNote(), these will be found, or created if they + * don't already exist. Created tags will have no parent (they will be at + * the top level of the tag panel). + *
      + * + *
      sharedNotes
      + *
      The list of recipients with whom this note has been shared. This field will be unset if + * the caller has access to the note via the containing notebook, but does not have activity + * feed permission for that notebook. This field is read-only. Clients may not make changes to + * a note's sharing state via this field. + *
      + * + *
      restrictions
      + *
      If this field is set, the user has note-level permissions that may differ from their + * notebook-level permissions. In this case, the restrictions structure specifies + * a set of restrictions limiting the actions that a user may take on the note based + * on their note-level permissions. If this field is unset, then there are no + * note-specific restrictions. However, a client may still be limited based on the user's + * notebook permissions.
      + *
      + */ +struct Note { + 1: optional Guid guid, + 2: optional string title, + 3: optional string content, + 4: optional binary contentHash, + 5: optional i32 contentLength, + 6: optional Timestamp created, + 7: optional Timestamp updated, + 8: optional Timestamp deleted, + 9: optional bool active, + 10: optional i32 updateSequenceNum, + 11: optional string notebookGuid, + 12: optional list tagGuids, + 13: optional list resources, + 14: optional NoteAttributes attributes, + 15: optional list tagNames, + 16: optional list sharedNotes, + 17: optional NoteRestrictions restrictions, + 18: optional NoteLimits limits +} + + +/** + * If a Notebook has been opened to the public, the Notebook will have a + * reference to one of these structures, which gives the location and optional + * description of the externally-visible public Notebook. + *
      + *
      uri
      + *
      If this field is present, then the notebook is published for + * mass consumption on the Internet under the provided URI, which is + * relative to a defined base publishing URI defined by the service. + * This field can only be modified via the web service GUI ... publishing + * cannot be modified via an offline client. + *
      + * Length: EDAM_PUBLISHING_URI_LEN_MIN - EDAM_PUBLISHING_URI_LEN_MAX + *
      + * Regex: EDAM_PUBLISHING_URI_REGEX + *
      + * + *
      order
      + *
      When the notes are publicly displayed, they will be sorted + * based on the requested criteria. + *
      + * + *
      ascending
      + *
      If this is set to true, then the public notes will be + * displayed in ascending order (e.g. from oldest to newest). Otherwise, + * the notes will be displayed in descending order (e.g. newest to oldest). + *
      + * + *
      publicDescription
      + *
      This field may be used to provide a short + * description of the notebook, which may be displayed when (e.g.) the + * notebook is shown in a public view. Can't begin or end with a space. + *
      + * Length: EDAM_PUBLISHING_DESCRIPTION_LEN_MIN - + * EDAM_PUBLISHING_DESCRIPTION_LEN_MAX + *
      + * Regex: EDAM_PUBLISHING_DESCRIPTION_REGEX + *
      + * + *
      + */ +struct Publishing { + 1: optional string uri, + 2: optional NoteSortOrder order, + 3: optional bool ascending, + 4: optional string publicDescription +} + +/** + * If a Notebook contained in an Evernote Business account has been published + * the to business library, the Notebook will have a reference to one of these + * structures, which specifies how the Notebook will be represented in the + * library. + * + *
      + *
      notebookDescription
      + *
      A short description of the notebook's content that will be displayed + * in the business library user interface. The description may not begin + * or end with whitespace. + *
      + * Length: EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MIN - + * EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MAX + *
      + * Regex: EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_REGEX + *
      + * + *
      privilege
      + *
      The privileges that will be granted to users who join the notebook through + * the business library. + *
      + * + *
      recommended
      + *
      Whether the notebook should be "recommended" when displayed in the business + * library user interface. + *
      + *
      + */ +struct BusinessNotebook { + 1: optional string notebookDescription, + 2: optional SharedNotebookPrivilegeLevel privilege, + 3: optional bool recommended +} + + +/** + * A structure defining the scope of a SavedSearch. + * + *
      + *
      includeAccount
      + *
      The search should include notes from the account that contains the SavedSearch.
      + * + *
      includePersonalLinkedNotebooks
      + *
      The search should include notes within those shared notebooks + * that the user has joined that are NOT business notebooks.
      + * + *
      includeBusinessLinkedNotebooks
      + *
      The search should include notes within those shared notebooks + * that the user has joined that are business notebooks in the business that + * the user is currently a member of.
      + *
      + */ +struct SavedSearchScope { + 1: optional bool includeAccount, + 2: optional bool includePersonalLinkedNotebooks, + 3: optional bool includeBusinessLinkedNotebooks +} + + +/** + * A named search associated with the account that can be quickly re-used. + *
      + *
      guid
      + *
      The unique identifier of this search. Will be set by the + * service, so may be omitted by the client when creating. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      name
      + *
      The name of the saved search to display in the GUI. The + * account may only contain one search with a given name (case-insensitive + * compare). Can't begin or end with a space. + *
      + * Length: EDAM_SAVED_SEARCH_NAME_LEN_MIN - EDAM_SAVED_SEARCH_NAME_LEN_MAX + *
      + * Regex: EDAM_SAVED_SEARCH_NAME_REGEX + *
      + * + *
      query
      + *
      A string expressing the search to be performed. + *
      + * Length: EDAM_SAVED_SEARCH_QUERY_LEN_MIN - EDAM_SAVED_SEARCH_QUERY_LEN_MAX + *
      + * + *
      format
      + *
      The format of the query string, to determine how to parse + * and process it. + *
      + * + *
      updateSequenceNum
      + *
      A number identifying the last transaction to + * modify the state of this object. The USN values are sequential within an + * account, and can be used to compare the order of modifications within the + * service. + *
      + * + *
      scope
      + *

      Specifies the set of notes that should be included in the search, if + * possible.

      + *

      Clients are expected to search as much of the desired scope as possible, + * with the understanding that a given client may not be able to cover the full + * specified scope. For example, when executing a search that includes notes in both + * the owner's account and business notebooks, a mobile client may choose to only + * search within the user's account because it is not capable of searching both + * scopes simultaneously. When a search across multiple scopes is not possible, + * a client may choose which scope to search based on the current application + * context. If a client cannot search any of the desired scopes, it should refuse + * to execute the search.

      + *
      + *
      + */ +struct SavedSearch { + 1: optional Guid guid, + 2: optional string name, + 3: optional string query, + 4: optional QueryFormat format, + 5: optional i32 updateSequenceNum, + 6: optional SavedSearchScope scope +} + +/** + * Settings meant for the recipient of a shared notebook, such as + * for indicating which types of notifications the recipient wishes + * for reminders, etc. + * + * The reminderNotifyEmail and reminderNotifyInApp fields have a + * 3-state read value but a 2-state write value. On read, it is + * possible to observe "unset", true, or false. The initial state is + * "unset". When you choose to set a value, you may set it to either + * true or false, but you cannot unset the value. Once one of these + * members has a true/false value, it will always have a true/false + * value. + * + *
      + *
      reminderNotifyEmail
      + *
      Indicates that the user wishes to receive daily e-mail notifications + * for reminders associated with the notebook. This may be true only for + * business notebooks that belong to the business of which the user is a + * member. You may only set this value on a notebook in your business.
      + *
      reminderNotifyInApp
      + *
      Indicates that the user wishes to receive notifications for + * reminders by applications that support providing such + * notifications. The exact nature of the notification is defined + * by the individual applications.
      + *
      + **/ +struct SharedNotebookRecipientSettings { + 1: optional bool reminderNotifyEmail, + 2: optional bool reminderNotifyInApp +} + +/** + * This enumeration defines the possible states that a notebook can be in for a recipient. + * It encompasses the "inMyList" boolean and default notebook status. + * + *
      + *
      NOT_IN_MY_LIST
      + *
      The notebook is not in the recipient's list (not "joined").
      + *
      IN_MY_LIST
      + *
      The notebook is in the recipient's notebook list (formerly, we would say + * that the recipient has "joined" the notebook)
      + *
      IN_MY_LIST_AND_DEFAULT_NOTEBOOK
      + *
      The same as IN_MY_LIST and this notebook is the user's default notebook.
      + *
      + */ +enum RecipientStatus { + NOT_IN_MY_LIST = 1, + IN_MY_LIST = 2, + IN_MY_LIST_AND_DEFAULT_NOTEBOOK = 3, +} + +/** + * Settings meant for the recipient of a notebook share. + * + * Some of these fields have a 3-state read value but a 2-state write value. + * On read, it is possible to observe "unset", true, or false. The initial + * state is "unset". When you choose to set a value, you may set it to either + * true or false, but you cannot unset the value. Once one of these members + * has a true/false value, it will always have a true/false value. + * + *
      + *
      reminderNotifyEmail
      + *
      Indicates that the user wishes to receive daily e-mail notifications + * for reminders associated with the notebook. This may be + * true only for business notebooks that belong to the business of + * which the user is a member. You may only set this value on a + * notebook in your business. This value will initially be unset.
      + *
      reminderNotifyInApp
      + *
      Indicates that the user wishes to receive notifications for + * reminders by applications that support providing such + * notifications. The exact nature of the notification is defined + * by the individual applications. This value will initially be unset.
      + *
      + *
      inMyList
      + *
      DEPRECATED: Use recipientStatus instead. + * The notebook is on the recipient's notebook list (formerly, we would say + * that the recipient has "joined" the notebook)
      + *
      recipientStatus
      + *
      The notebook is on/off the recipient's notebook list (formerly, we would say + * that the recipient has "joined" the notebook) and perhaps also their + * default notebook
      + *
      stack
      + *
      The stack the recipient has put this notebook into. See Notebook.stack + * for a definition. Every recipient can have their own stack value for the same + * notebook.
      + *
      + **/ +struct NotebookRecipientSettings { + 1: optional bool reminderNotifyEmail, + 2: optional bool reminderNotifyInApp, + 3: optional bool inMyList, + 4: optional string stack, + 5: optional RecipientStatus recipientStatus, +} + +/** + * Shared notebooks represent a relationship between a notebook and a single + * share invitation recipient. + *
      + *
      id
      + *
      The primary identifier of the share, which is not globally unique.
      + * + *
      userId
      + *
      The user id of the owner of the notebook.
      + * + *
      notebookGuid
      + *
      The GUID of the notebook that has been shared.
      + * + *
      email
      + *
      A string containing a display name for the recipient of the share. This may + * be an email address, a phone number, a full name, or some other descriptive + * string This field is read-only to clients. It will be filled in by the service + * when returning shared notebooks. + *
      + * + *
      recipientIdentityId
      + *
      The IdentityID of the share recipient. If present, only the user who has + * claimed that identity may access this share. + *
      + * + *
      notebookModifiable
      + *
      DEPRECATED
      + * + *
      serviceCreated
      + *
      The date that the owner first created the share with the specific email + * address.
      + * + *
      serviceUpdated
      + *
      The date the shared notebook was last updated on the service. This + * will be updated when authenticateToSharedNotebook is called the first + * time with a shared notebook (i.e. when the username is bound to that + * shared notebook), and also when the SharedNotebook privilege is updated + * as part of a shareNotebook(...) call, as well as on any calls to + * updateSharedNotebook(...). + *
      + * + *
      username
      + *
      DEPRECATED. The username of the user who can access this share. This + * value is read-only to clients. It will be filled in by the service when + * returning shared notebooks. + *
      + * + *
      privilege
      + *
      The privilege level granted to the notebook, activity stream, and + * invitations. See the corresponding enumeration for details. + *
      + * + *
      recipientSettings
      + *
      Settings intended for use only by the recipient of this shared + * notebook. You should skip setting this value unless you want + * to change the value contained inside the structure, and only if + * you are the recipient.
      + * + *
      globalId
      + *
      An immutable, opaque string that acts as a globally unique + * identifier for this shared notebook record. You can use this field to + * match linked notebook and shared notebook records as well as to + * create new LinkedNotebook records. This field replaces the deprecated + * shareKey field. + *
      + * + *
      sharerUserId
      + *
      The user id of the user who shared a notebook via this shared notebook + * instance. This may not be the same as userId, since a user with full + * access to a notebook may have created a new share for that notebook. For + * Business, this represents the user who shared the business notebook. This + * field is currently unset for a SharedNotebook created by joining a + * notebook that has been published to the business. + *
      + * + *
      recipientUsername
      + *
      The username of the user who can access this share. This is the username + * for the user with the id in recipientUserId. This value can be set + * by clients when calling shareNotebook(...), and that will result in the + * created SharedNotebook being assigned to a user. This value is always set + * if serviceAssigned is set. + *
      + * + *
      recipientUserId
      + *
      The id of the user who can access this share. This is the id for the user + * with the username in recipientUsername. This value is read-only and set + * by the service. Value set by clients will be ignored. This field may be unset + * for unjoined notebooks and is always set if serviceAssigned is set. Clients should + * prefer this field over recipientUsername unless they need to use usernames + * directly. + *
      + * + *
      serviceAssigned
      + *
      The date this SharedNotebook was assigned (i.e. has been associated with an + * Evernote user whose user ID is set in recipientUserId). Unset if the SharedNotebook + * is not assigned. This field is a read-only value that is set by the service. + *
      + *
      + */ +struct SharedNotebook { + 1: optional i64 id, + 2: optional UserID userId, + 3: optional Guid notebookGuid, + 4: optional string email, + 18: optional IdentityID recipientIdentityId, + 5: optional bool notebookModifiable, // deprecated + 7: optional Timestamp serviceCreated, + 10: optional Timestamp serviceUpdated, + 8: optional string globalId, // rename from shareKey + 9: optional string username, // deprecated + 11: optional SharedNotebookPrivilegeLevel privilege, + 13: optional SharedNotebookRecipientSettings recipientSettings, + 14: optional UserID sharerUserId, + 15: optional string recipientUsername, + 17: optional UserID recipientUserId, + 16: optional Timestamp serviceAssigned +} + +/** + * This enumeration defines the possible types of canMoveToContainer outcomes. + *

      + * An outdated client is expected to signal a "Cannot Move, Please Upgrade To Learn Why" + * like response to the user if an unknown enumeration value is received. + *

      + *
      CAN_BE_MOVED
      + *
      Can move Notebook to Workspace.
      + *
      INSUFFICIENT_ENTITY_PRIVILEGE
      + *
      Can not move Notebook to Workspace, because either: + * a) Notebook not in Workspace and insufficient privilege on Notebook + * or b) Notebook in Workspace and membership on Workspace with insufficient privilege + * for move
      + *
      INSUFFICIENT_CONTAINER_PRIVILEGE
      + *
      Notebook in Workspace and no membership on Workspace. + *
      + *
      + */ +enum CanMoveToContainerStatus { + CAN_BE_MOVED = 1, + INSUFFICIENT_ENTITY_PRIVILEGE = 2, + INSUFFICIENT_CONTAINER_PRIVILEGE = 3 +} + +/** + * Specifies if the client can move a Notebook to a Workspace. + */ +struct CanMoveToContainerRestrictions { + 1: optional CanMoveToContainerStatus canMoveToContainer +} + +/** + * This structure captures information about the types of operations + * that cannot be performed on a given notebook with a type of + * authenticated access and credentials. The values filled into this + * structure are based on then-current values in the server database + * for shared notebooks and notebook publishing records, as well as + * information related to the authentication token. Information from + * the authentication token includes the application that is accessing + * the server, as defined by the permissions granted by consumer (api) + * key, and the method used to obtain the token, for example via + * authenticateToSharedNotebook, authenticateToBusiness, etc. Note + * that changes to values in this structure that are the result of + * shared notebook or publishing record changes are communicated to + * the client via a change in the notebook USN during sync. It is + * important to use the same access method, parameters, and consumer + * key in order obtain correct results from the sync engine. + * + * The server has the final say on what is allowed as values may + * change between calls to obtain NotebookRestrictions instances + * and to operate on data on the service. + * + * If the following are set and true, then the given restriction is + * in effect, as accessed by the same authentication token from which + * the values were obtained. + * + *
      + *
      noReadNotes
      + *
      The client is not able to read notes from the service and + * the notebook is write-only. + *
      + *
      noCreateNotes
      + *
      The client may not create new notes in the notebook. + *
      + *
      noUpdateNotes
      + *
      The client may not update notes currently in the notebook. + *
      + *
      noExpungeNotes
      + *
      The client may not expunge notes currently in the notebook. + *
      + *
      noShareNotes
      + *
      The client may not share notes in the notebook via the + * shareNote or createOrUpdateSharedNotes methods. + *
      + *
      noEmailNotes
      + *
      The client may not e-mail notes by guid via the Evernote + * service by using the emailNote method. Email notes by value + * by populating the note parameter instead. + *
      + *
      noSendMessageToRecipients
      + *
      The client may not send messages to the share recipients of + * the notebook. + *
      + *
      noUpdateNotebook
      + *
      The client may not update the Notebook object itself, for + * example, via the updateNotebook method. + *
      + *
      noExpungeNotebook
      + *
      The client may not expunge the Notebook object itself, for + * example, via the expungeNotebook method. + *
      + *
      noSetDefaultNotebook
      + *
      The client may not set this notebook to be the default notebook. + * The caller should leave Notebook.defaultNotebook unset. + *
      + *
      noSetNotebookStack
      + *
      If the client is able to update the Notebook, the Notebook.stack + * value may not be set. + *
      + *
      noPublishToPublic
      + *
      The client may not publish the notebook to the public. + * For example, business notebooks may not be shared publicly. + *
      + *
      noPublishToBusinessLibrary
      + *
      The client may not publish the notebook to the business library. + *
      + *
      noCreateTags
      + *
      The client may not complete an operation that results in a new tag + * being created in the owner's account. + *
      + *
      noUpdateTags
      + *
      The client may not update tags in the owner's account. + *
      + *
      noExpungeTags
      + *
      The client may not expunge tags in the owner's account. + *
      + *
      noSetParentTag
      + *
      If the client is able to create or update tags in the owner's account, + * then they will not be able to set the parent tag. Leave the value unset. + *
      + *
      noCreateSharedNotebooks
      + *
      The client is unable to create shared notebooks for the notebook. + *
      + *
      updateWhichSharedNotebookRestrictions
      + *
      Restrictions on which shared notebook instances can be updated. If the + * value is not set or null, then the client can update any of the shared notebooks + * associated with the notebook on which the NotebookRestrictions are defined. + * See the enumeration for further details. + *
      + *
      expungeWhichSharedNotebookRestrictions
      + *
      Restrictions on which shared notebook instances can be expunged. If the + * value is not set or null, then the client can expunge any of the shared notebooks + * associated with the notebook on which the NotebookRestrictions are defined. + * See the enumeration for further details. + *
      + *
      noShareNotesWithBusiness
      + *
      The client may not share notes in the notebook via the shareNoteWithBusiness + * method. + *
      + *
      noRenameNotebook
      + *
      The client may not rename this notebook.
      + *
      noSetInMyList
      + *
      clients may not change the NotebookRecipientSettings.inMyList settings for + * this notebook.
      + *
      noSetContact
      + *
      The contact for this notebook may not be changed.
      + *
      + *
      canMoveToContainerRestrictions
      + *
      Specifies if the client can move this notebook to a container and if not, + * the reason why.
      + *
      noCanMoveNote
      + *
      If set, the client cannot move a Note into or out of the Notebook.
      + *
+ */ +struct NotebookRestrictions { + 1: optional bool noReadNotes, + 2: optional bool noCreateNotes, + 3: optional bool noUpdateNotes, + 4: optional bool noExpungeNotes, + 5: optional bool noShareNotes, + 6: optional bool noEmailNotes, + 7: optional bool noSendMessageToRecipients, + 8: optional bool noUpdateNotebook, + 9: optional bool noExpungeNotebook, + 10: optional bool noSetDefaultNotebook, + 11: optional bool noSetNotebookStack, + 12: optional bool noPublishToPublic, + 13: optional bool noPublishToBusinessLibrary, + 14: optional bool noCreateTags, + 15: optional bool noUpdateTags, + 16: optional bool noExpungeTags, + 17: optional bool noSetParentTag, + 18: optional bool noCreateSharedNotebooks, + 19: optional SharedNotebookInstanceRestrictions updateWhichSharedNotebookRestrictions, + 20: optional SharedNotebookInstanceRestrictions expungeWhichSharedNotebookRestrictions, + 21: optional bool noShareNotesWithBusiness, + 22: optional bool noRenameNotebook, + 23: optional bool noSetInMyList, + 24: optional bool noChangeContact, + 26: optional CanMoveToContainerRestrictions canMoveToContainerRestrictions, + 27: optional bool noSetReminderNotifyEmail, + 28: optional bool noSetReminderNotifyInApp, + 29: optional bool noSetRecipientSettingsStack, + 30: optional bool noCanMoveNote +} + +/** + * A unique container for a set of notes. + *
+ *
guid
+ *
The unique identifier of this notebook. + *
+ * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
+ * Regex: EDAM_GUID_REGEX + *
+ * + *
name
+ *
A sequence of characters representing the name of the + * notebook. May be changed by clients, but the account may not contain two + * notebooks with names that are equal via a case-insensitive comparison. + * Can't begin or end with a space. + *
+ * Length: EDAM_NOTEBOOK_NAME_LEN_MIN - EDAM_NOTEBOOK_NAME_LEN_MAX + *
+ * Regex: EDAM_NOTEBOOK_NAME_REGEX + *
+ * + *
updateSequenceNum
+ *
A number identifying the last transaction to + * modify the state of this object. The USN values are sequential within an + * account, and can be used to compare the order of modifications within the + * service. + *
+ * + *
defaultNotebook
+ *
If true, this notebook should be used for new notes + * whenever the user has not (or cannot) specify a desired target notebook. + * For example, if a note is submitted via SMTP email. + * The service will maintain at most one defaultNotebook per account. + * If a second notebook is created or updated with defaultNotebook set to + * true, the service will automatically update the prior notebook's + * defaultNotebook field to false. If the default notebook is deleted + * (i.e. "active" set to false), the "defaultNotebook" field will be + * set to false by the service. If the account has no default notebook + * set, the service will use the most recent notebook as the default. + *
+ * + *
serviceCreated
+ *
The time when this notebook was created on the + * service. This will be set on the service during creation, and the service + * will provide this value when it returns a Notebook to a client. + * The service will ignore this value if it is sent by clients. + *
+ * + *
serviceUpdated
+ *
The time when this notebook was last modified on the + * service. This will be set on the service during creation, and the service + * will provide this value when it returns a Notebook to a client. + * The service will ignore this value if it is sent by clients. + *
+ * + *
publishing
+ *
If the Notebook has been opened for public access, then this will point to the set of + * publishing information for the Notebook (URI, description, etc.). A Notebook cannot be + * published without providing this information, but it will persist for later use if publishing + * is ever disabled on the Notebook. Clients that do not wish to change the publishing behavior + * of a Notebook should not set this value when calling NoteStore.updateNotebook(). + * Note that this structure is never populated for business notebooks, see the businessNotebook + * field. + *
+ * + *
published
+ *
If this is set to true, then the Notebook will be + * accessible either to the public, or for business users to their business, + * via the 'publishing' or 'businessNotebook' specifications, which must also be set. If this is + * set to false, the Notebook will not be available to the public (or business). + * Clients that do not wish to change the publishing behavior of a Notebook + * should not set this value when calling NoteStore.updateNotebook(). + *
+ * + *
stack
+ *
If this is set, then the notebook is visually contained within a stack + * of notebooks with this name. All notebooks in the same account with the + * same 'stack' field are considered to be in the same stack. + * Notebooks with no stack set are "top level" and not contained within a + * stack. + *
+ * + *
sharedNotebookIds
+ *
DEPRECATED - replaced by sharedNotebooks.
+ * + *
sharedNotebooks
+ *
The list of recipients to whom this notebook has been shared + * (one SharedNotebook object per recipient email address). This field will + * be unset if you do not have permission to access this data. If you are + * accessing the notebook as the owner or via a shared notebook that is + * modifiable, then you have access to this data and the value will be set. + * This field is read-only. Clients may not make changes to shared notebooks + * via this field. + *
+ * + *
businessNotebook
+ *
If the notebook is part of a business account and has been shared with the entire + * business, this will contain sharing information. The presence or absence of this field + * is not a reliable test of whether a given notebook is in fact a business notebook - the + * field is only used when a notebook is or has been shared with the entire business. + *
+ * + *
contact
+ *
Intended for use with Business accounts, this field identifies the user who + * has been designated as the "contact". For notebooks created in business + * accounts, the server will automatically set this value to the user who created + * the notebook unless Notebook.contact.username has been set, in which that value + * will be used. When updating a notebook, it is common to leave Notebook.contact + * field unset, indicating that no change to the value is being requested and that + * the existing value, if any, should be preserved. + *
+ * + *
recipientSettings
+ *
This represents the preferences/settings that a recipient has set for this + * notebook. These are intended to be changed only by the recipient, and each + * recipient has their own recipient settings. + *
+ *
+ */ +struct Notebook { + 1: optional Guid guid, + 2: optional string name, + 5: optional i32 updateSequenceNum, + 6: optional bool defaultNotebook, + 7: optional Timestamp serviceCreated, + 8: optional Timestamp serviceUpdated, + 10: optional Publishing publishing, + 11: optional bool published, + 12: optional string stack, + 13: optional list sharedNotebookIds, + 14: optional list sharedNotebooks, + 15: optional BusinessNotebook businessNotebook, + 16: optional User contact, + 17: optional NotebookRestrictions restrictions, + 18: optional NotebookRecipientSettings recipientSettings +} + +/** + * A link in a user's account that refers them to a public or + * individual shared notebook in another user's account. + * + *
+ *
shareName
+ *
The display name of the shared notebook. The link owner can change this.
+ * + *
username
+ *
The username of the user who owns the shared or public notebook.
+ * + *
shardId
+ *
The shard ID of the notebook if the notebook is not public. + * + *
uri
+ *
The identifier of the public notebook.
+ * + *
guid
+ *
The unique identifier of this linked notebook. Will be set whenever + * a linked notebook is retrieved from the service, but may be null when a client + * is creating a linked notebook. + *
+ * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
+ * Regex: EDAM_GUID_REGEX + *
+ * + *
updateSequenceNum
+ *
A number identifying the last transaction to + * modify the state of this object. The USN values are sequential within an + * account, and can be used to compare the order of modifications within the + * service. + *
+ * + *
noteStoreUrl
+ *
+ * This field will contain the full URL that clients should use to make + * NoteStore requests to the server shard that contains that notebook's data. + * I.e. this is the URL that should be used to create the Thrift HTTP client + * transport to send messages to the NoteStore service for the account. + *
+ * + *
webApiUrlPrefix:
+ *
+ * This field will contain the initial part of the URLs that should be used + * to make requests to Evernote's thin client "web API", which provide + * optimized operations for clients that aren't capable of manipulating + * the full contents of accounts via the full Thrift data model. Clients + * should concatenate the relative path for the various servlets onto the + * end of this string to construct the full URL, as documented on our + * developer web site. + *
+ * + *
stack
+ *
If this is set, then the notebook is visually contained within a stack + * of notebooks with this name. All notebooks in the same account with the + * same 'stack' field are considered to be in the same stack. + * Notebooks with no stack set are "top level" and not contained within a + * stack. The link owner can change this and this field is for the benefit + * of the link owner. + *
+ * + *
businessId
+ *
If set, this will be the unique identifier for the business that owns + * the notebook to which the linked notebook refers.
+ * + *
sharedNotebookGlobalId
+ *
The globally unique identifier (globalId) of the shared notebook that + * corresponds to the share key, or the GUID of the Notebook that the linked notebook + * refers to. This field must be filled in with the SharedNotebook.globalId or + * Notebook.GUID value when creating new LinkedNotebooks. This field replaces the + * deprecated "shareKey" field. + *
+ *
+ */ +struct LinkedNotebook { + 2: optional string shareName, + 3: optional string username, + 4: optional string shardId, + 5: optional string sharedNotebookGlobalId, // rename from shareKey + 6: optional string uri, + 7: optional Guid guid, + 8: optional i32 updateSequenceNum, + 9: optional string noteStoreUrl, + 10: optional string webApiUrlPrefix, + 11: optional string stack, + 12: optional i32 businessId +} + +/** + * A structure that describes a notebook or a user's relationship with + * a notebook. NotebookDescriptor is expected to remain a lighter-weight + * structure when compared to Notebook. + *
+ *
guid
+ *
The unique identifier of the notebook. + *
+ * + *
notebookDisplayName
+ *
A sequence of characters representing the name of the + * notebook. + *
+ * + *
contactName
+ *
The User.name value of the notebook's "contact". + *
+ * + *
hasSharedNotebook
+ *
Whether a SharedNotebook record exists between the calling user and this + * notebook. + *
+ * + *
joinedUserCount
+ *
The number of users who have joined this notebook. + *
+ * + *
+ */ +struct NotebookDescriptor { + 1: optional Guid guid, + 2: optional string notebookDisplayName, + 3: optional string contactName, + 4: optional bool hasSharedNotebook, + 5: optional i32 joinedUserCount +} + +/** + * This structure represents profile information for a user in a business. + * + *
+ *
id
+ *
The numeric identifier that uniquely identifies a user.
+ * + *
name
+ *
The full name of the user.
+ * + *
email
+ *
The user's business email address. If the user has not registered their business + * email address, this field will be empty. + *
+ * + *
username
+ *
The user's Evernote username.
+ * + *
attributes
+ *
The user's business specific attributes.
+ * + *
joined
+ *
The time when the user joined the business
+ * + *
photoLastUpdated
+ *
The time when the user's profile photo was most recently updated
+ * + *
photoUrl
+ *
A URL identifying a copy of the user's current profile photo
+ * + *
role
+ *
The BusinessUserRole for the user
+ * + *
status
+ *
The BusinessUserStatus for the user
+ * + *
+ */ +struct UserProfile { + 1: optional UserID id, + 2: optional string name, + 3: optional string email, + 4: optional string username, + 5: optional BusinessUserAttributes attributes, + 6: optional Timestamp joined + 7: optional Timestamp photoLastUpdated, + 8: optional string photoUrl, + 9: optional BusinessUserRole role, + 10: optional BusinessUserStatus status +} + +/** + * This enumeration defines the possible types of related content. + * + * NEWS_ARTICLE: This related content is a news article + * PROFILE_PERSON: This match refers to the profile of an individual person + * PROFILE_ORGANIZATION: This match refers to the profile of an organization + * REFERENCE_MATERIAL: This related content is material from reference works + */ +enum RelatedContentType { + NEWS_ARTICLE = 1, + PROFILE_PERSON = 2, + PROFILE_ORGANIZATION = 3, + REFERENCE_MATERIAL = 4, +} + +/** + * This enumeration defines the possible ways to access related content. + * + * NOT_ACCESSIBLE: The content is not accessible given the user's privilege level, but + * still worth showing as a snippet. The content url may point to a webpage that + * explains why not, or explains how to access that content. + * + * DIRECT_LINK_ACCESS_OK: The content is accessible directly, and no additional login is + * required. + * + * DIRECT_LINK_LOGIN_REQUIRED: The content is accessible directly, but an additional login + * is required. + * + * DIRECT_LINK_EMBEDDED_VIEW: The content is accessible directly, and should be shown in + * an embedded web view. + * If the URL refers to a secured location under our control (for example, + * https://www.evernote.com/*), the client may include user-specific authentication + * credentials with the request. + */ +enum RelatedContentAccess { + NOT_ACCESSIBLE = 0, + DIRECT_LINK_ACCESS_OK = 1, + DIRECT_LINK_LOGIN_REQUIRED = 2, + DIRECT_LINK_EMBEDDED_VIEW = 3, +} + +/** + * An external image that can be shown with a related content snippet, + * usually either a JPEG or PNG image. It is up to the client which image(s) are shown, + * depending on available screen real estate, resolution and aspect ratio. + * + *
+ *
url
+ *
The external URL of the image
+ *
width
+ *
The width of the image, in pixels.
+ *
height
+ *
The height of the image, in pixels.
+ *
pixelRatio
+ *
the pixel ratio (usually either 1.0, 1.5 or 2.0)
+ *
fileSize
+ *
the size of the image file, in bytes
+ *
+ */ +struct RelatedContentImage { + 1: optional string url, + 2: optional i32 width, + 3: optional i32 height, + 4: optional double pixelRatio, + 5: optional i32 fileSize +} + +/** + * A structure identifying one snippet of related content (some information that is not + * part of an Evernote account but might still be relevant to the user). + * + *
+ * + *
contentId
+ *
An identifier that uniquely identifies the content.
+ * + *
title
+ *
The main title to show.
+ * + *
url
+ *
The URL the client can use to retrieve the content.
+ * + *
sourceId
+ *
An identifier that uniquely identifies the source.
+ * + *
sourceUrl
+ *
A URL the client can access to know more about the source.
+ * + *
sourceFaviconUrl
+ *
The favicon URL of the source which the content belongs to.
+ *
+ * + *
sourceName
+ *
A human-readable name of the source that provided this content.
+ * + *
date
+ *
A timestamp telling the user about the recency of the content.
+ * + *
teaser
+ *
A teaser text to show to the user; usually the first few sentences of the content, + * excluding the title.
+ * + *
thumbnails
+ *
A list of thumbnails the client can show in the snippet.
+ * + *
contentType
+ *
The type of this related content.
+ * + *
accessType
+ *
An indication of how this content can be accessed. This type influences the + * semantics of the url parameter.
+ * + *
visibleUrl
+ *
If set, the client should show this URL to the user, instead of the URL that was + * used to retrieve the content. This URL should be used when opening the content + * in an external browser window, or when sharing with another person.
+ * + *
clipUrl
+ *
If set, the client should use this URL for clipping purposes, instead of the URL + * that was used to retrieve the content. The clipUrl may directly point to an .enex + * file, for example.
+ * + *
contact
+ *
If set, the client may use this Contact for messaging purposes. This will typically + * only be set for user profiles.
+ * + *
authors
+ *
For News articles only. A list of names of the article authors, if available.
+ * + * + */ +struct RelatedContent { + 1: optional string contentId, + 2: optional string title, + 3: optional string url, + 4: optional string sourceId, + 5: optional string sourceUrl, + 6: optional string sourceFaviconUrl, + 7: optional string sourceName, + 8: optional Timestamp date, + 9: optional string teaser, + 10: optional list thumbnails, + 11: optional RelatedContentType contentType, + 12: optional RelatedContentAccess accessType, + 13: optional string visibleUrl, + 14: optional string clipUrl, + 15: optional Contact contact, + 16: optional list authors, +} + +/** + * A structure describing an invitation to join a business account. + * + *
+ *
businessId
+ *
+ * The ID of the business to which the invitation grants access. + *
+ * + *
email
+ *
+ * The email address that was invited to join the business. + *
+ * + *
role
+ *
+ * The role to grant the user after the invitation is accepted. + *
+ * + *
status
+ *
+ * The status of the invitation. + *
+ * + *
requesterId
+ *
+ * For invitations that were initially requested by a non-admin member of the business, + * this field specifies the user ID of the requestor. For all other invitations, this field + * will be unset. + *
+ *
fromWorkChat
+ *
+ * If this invitation was created implicitly via a WorkChat, this field + * will be true. + *
+ *
created
+ *
+ * The timestamp at which this invitation was created. + *
+ *
mostRecentReminder
+ *
+ * The timestamp at which the most recent reminder was sent. + *
+ *
+ */ +struct BusinessInvitation { + 1: optional i32 businessId, + 2: optional string email, + 3: optional BusinessUserRole role, + 4: optional BusinessInvitationStatus status, + 5: optional UserID requesterId, + 6: optional bool fromWorkChat, + 7: optional Timestamp created, + 8: optional Timestamp mostRecentReminder +} + +/** + * + */ +enum UserIdentityType { + EVERNOTE_USERID = 1, + EMAIL = 2, + IDENTITYID = 3 +} + +/** + * A structure that holds user identifying information such as an + * email address, Evernote user ID, or an identifier from a 3rd party + * service. An instance consists of a type and a value, where the + * value will be stored in one of the value fields depending upon the + * data type required for the identity type. + * + * When used with shared notebook invitations, a UserIdentity + * identifies a particular person who may not (yet) have an Evernote + * UserID UserIdentity but who has (almost) unique access to the + * service endpoint described by the UserIdentity. For example, an + * e-mail UserIdentity can identify the person who receives e-mail at + * the given address, and who can therefore read the share key that + * has a cryptographic signature from the Evernote service. With the + * share key, this person can supply their Evernote UserID via an + * authentication token to join the notebook + * (authenticateToSharedNotebook), at which time we have associated + * the e-mail UserIdentity with an Evernote UserID UserIdentity. Note + * that using shared notebook records, the relationship between + * Evernote UserIDs and e-mail addresses is many to many. + * + * Note that the identifier may not directly identify a + * particular Evernote UserID UserIdentity without further + * verification. For example, an e-mail UserIdentity may be + * associated with an invitation to join a notebook (via a shared + * notebook record), but until a user uses a share key, that was sent + * to that e-mail address, to join the notebook, we do not know an + * Evernote UserID UserIdentity ID to match the e-mail address. + */ +struct UserIdentity { + 1: optional UserIdentityType type, + 2: optional string stringIdentifier, + 3: optional i64 longIdentifier +} diff --git a/tests/evernote-thrift/src/UserStore.thrift b/tests/evernote-thrift/src/UserStore.thrift new file mode 100644 index 0000000..e7dea02 --- /dev/null +++ b/tests/evernote-thrift/src/UserStore.thrift @@ -0,0 +1,830 @@ +/* + * Copyright 2007-2018 Evernote Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file contains the EDAM protocol interface for operations to query + * and/or authenticate users. + */ + +include "Types.thrift" +include "Errors.thrift" + +namespace as3 com.evernote.edam.userstore +namespace java com.evernote.edam.userstore +namespace csharp Evernote.EDAM.UserStore +namespace py evernote.edam.userstore +namespace cpp evernote.edam +namespace rb Evernote.EDAM.UserStore +namespace php EDAM.UserStore +namespace cocoa EDAM +namespace perl EDAMUserStore +namespace go edam + + +/** + * The major version number for the current revision of the EDAM protocol. + * Clients pass this to the service using UserStore.checkVersion at the + * beginning of a session to confirm that they are not out of date. + */ +const i16 EDAM_VERSION_MAJOR = 1 + +/** + * The minor version number for the current revision of the EDAM protocol. + * Clients pass this to the service using UserStore.checkVersion at the + * beginning of a session to confirm that they are not out of date. + */ +const i16 EDAM_VERSION_MINOR = 28 + +//============================= Enumerations ================================== + +/** + * This structure is used to provide publicly-available user information + * about a particular account. + *
+ *
userId:
+ *
+ * The unique numeric user identifier for the user account. + *
+ *
serviceLevel:
+ *
+ * The service level of the account. + *
+ *
noteStoreUrl:
+ *
+ * This field will contain the full URL that clients should use to make + * NoteStore requests to the server shard that contains that user's data. + * I.e. this is the URL that should be used to create the Thrift HTTP client + * transport to send messages to the NoteStore service for the account. + *
+ *
webApiUrlPrefix:
+ *
+ * This field will contain the initial part of the URLs that should be used + * to make requests to Evernote's thin client "web API", which provide + * optimized operations for clients that aren't capable of manipulating + * the full contents of accounts via the full Thrift data model. Clients + * should concatenate the relative path for the various servlets onto the + * end of this string to construct the full URL, as documented on our + * developer web site. + *
+ *
+ */ +struct PublicUserInfo { + 1: required Types.UserID userId, + 7: optional Types.ServiceLevel serviceLevel, + 4: optional string username, + 5: optional string noteStoreUrl, + 6: optional string webApiUrlPrefix +} + +/** + *
+ *
noteStoreUrl:
+ *
+ * This field will contain the full URL that clients should use to make + * NoteStore requests to the server shard that contains that user's data. + * I.e. this is the URL that should be used to create the Thrift HTTP client + * transport to send messages to the NoteStore service for the account. + *
+ *
webApiUrlPrefix:
+ *
+ * This field will contain the initial part of the URLs that should be used + * to make requests to Evernote's thin client "web API", which provide + * optimized operations for clients that aren't capable of manipulating + * the full contents of accounts via the full Thrift data model. Clients + * should concatenate the relative path for the various servlets onto the + * end of this string to construct the full URL, as documented on our + * developer web site. + *
+ *
userStoreUrl:
+ *
+ * This field will contain the full URL that clients should use to make UserStore + * requests after successfully authenticating. I.e. this is the URL that should be used + * to create the Thrift HTTP client transport to send messages to the UserStore service + * for this account. + *
+ *
utilityUrl:
+ *
+ * This field will contain the full URL that clients should use to make Utility requests + * to the server shard that contains that user's data. I.e. this is the URL that should + * be used to create the Thrift HTTP client transport to send messages to the Utility + * service for the account. + *
+ *
messageStoreUrl:
+ *
+ * This field will contain the full URL that clients should use to make MessageStore + * requests to the server. I.e. this is the URL that should be used to create the + * Thrift HTTP client transport to send messages to the MessageStore service for the + * account. + *
+ *
userWebSocketUrl:
+ *
+ * This field will contain the full URL that clients should use when opening a + * persistent web socket to recieve notification of events for the authenticated user. + *
+ *
+ */ +struct UserUrls { + 1: optional string noteStoreUrl, + 2: optional string webApiUrlPrefix, + 3: optional string userStoreUrl, + 4: optional string utilityUrl, + 5: optional string messageStoreUrl, + 6: optional string userWebSocketUrl +} + +/** + * When an authentication (or re-authentication) is performed, this structure + * provides the result to the client. + *
+ *
currentTime:
+ *
+ * The server-side date and time when this result was + * generated. + *
+ *
authenticationToken:
+ *
+ * Holds an opaque, ASCII-encoded token that can be + * used by the client to perform actions on a NoteStore. + *
+ *
expiration:
+ *
+ * Holds the server-side date and time when the + * authentication token will expire. + * This time can be compared to "currentTime" to produce an expiration + * time that can be reconciled with the client's local clock. + *
+ *
user:
+ *
+ * Holds the information about the account which was + * authenticated if this was a full authentication. May be absent if this + * particular authentication did not require user information. + *
+ *
publicUserInfo:
+ *
+ * If this authentication result was achieved without full permissions to + * access the full User structure, this field may be set to give back + * a more limited public set of data. + *
+ *
noteStoreUrl:
+ *
+ * DEPRECATED - Client applications should use urls.noteStoreUrl. + *
+ *
webApiUrlPrefix:
+ *
+ * DEPRECATED - Client applications should use urls.webApiUrlPrefix. + *
+ *
secondFactorRequired:
+ *
+ * If set to true, this field indicates that the user has enabled two-factor + * authentication and must enter their second factor in order to complete + * authentication. In this case the value of authenticationResult will be + * a short-lived authentication token that may only be used to make a + * subsequent call to completeTwoFactorAuthentication. + *
+ *
secondFactorDeliveryHint:
+ *
+ * When secondFactorRequired is set to true, this field may contain a string + * describing the second factor delivery method that the user has configured. + * This will typically be an obfuscated mobile device number, such as + * "(xxx) xxx-x095". This string can be displayed to the user to remind them + * how to obtain the required second factor. + *
+ *
urls
+ *
+ * This structure will contain all of the URLs that clients need to make requests to the + * Evernote service on behalf of the authenticated User. + *
+ *
+ */ +struct AuthenticationResult { + 1: required Types.Timestamp currentTime, + 2: required string authenticationToken, + 3: required Types.Timestamp expiration, + 4: optional Types.User user, + 5: optional PublicUserInfo publicUserInfo, + 6: optional string noteStoreUrl, + 7: optional string webApiUrlPrefix, + 8: optional bool secondFactorRequired, + 9: optional string secondFactorDeliveryHint, + 10: optional UserUrls urls +} + +/** + * This structure describes a collection of bootstrap settings. + *
+ *
serviceHost:
+ *
+ * The hostname and optional port for composing Evernote web service URLs. + * This URL can be used to access the UserStore and related services, + * but must not be used to compose the NoteStore URL. Client applications + * must handle serviceHost values that include only the hostname + * (e.g. www.evernote.com) or both the hostname and port (e.g. www.evernote.com:8080). + * If no port is specified, or if port 443 is specified, client applications must + * use the scheme "https" when composing URLs. Otherwise, a client must use the + * scheme "http". + *
+ *
marketingUrl:
+ *
+ * The URL stem for the Evernote corporate marketing website, e.g. http://www.evernote.com. + * This stem can be used to compose website URLs. For example, the URL of the Evernote + * Trunk is composed by appending "/about/trunk/" to the value of marketingUrl. + *
+ *
supportUrl:
+ *
+ * The full URL for the Evernote customer support website, e.g. https://support.evernote.com. + *
+ *
accountEmailDomain:
+ *
+ * The domain used for an Evernote user's incoming email address, which allows notes to + * be emailed into an account. E.g. m.evernote.com. + *
+ *
enableFacebookSharing:
+ *
+ * Whether the client application should enable sharing of notes on Facebook. + *
+ *
enableGiftSubscriptions:
+ *
+ * Whether the client application should enable gift subscriptions. + *
+ *
enableSupportTickets:
+ *
+ * Whether the client application should enable in-client creation of support tickets. + *
+ *
enableSharedNotebooks:
+ *
+ * Whether the client application should enable shared notebooks. + *
+ *
enableSingleNoteSharing:
+ *
+ * Whether the client application should enable single note sharing. + *
+ *
enableSponsoredAccounts:
+ *
+ * Whether the client application should enable sponsored accounts. + *
+ *
enableTwitterSharing:
+ *
+ * Whether the client application should enable sharing of notes on Twitter. + *
+ *
enableGoogle:
+ *
+ * Whether the client application should enable authentication with Google, + * for example to allow integration with a user's Gmail contacts. + *
+ */ +struct BootstrapSettings { + 1: required string serviceHost, + 2: required string marketingUrl, + 3: required string supportUrl, + 4: required string accountEmailDomain, + 5: optional bool enableFacebookSharing, + 6: optional bool enableGiftSubscriptions, + 7: optional bool enableSupportTickets, + 8: optional bool enableSharedNotebooks, + 9: optional bool enableSingleNoteSharing, + 10: optional bool enableSponsoredAccounts, + 11: optional bool enableTwitterSharing, + 12: optional bool enableLinkedInSharing, + 13: optional bool enablePublicNotebooks, + 16: optional bool enableGoogle +} + +/** + * This structure describes a collection of bootstrap settings. + *
+ *
name:
+ *
+ * The unique name of the profile, which is guaranteed to remain consistent across + * calls to getBootstrapInfo. + *
+ *
settings:
+ *
+ * The settings for this profile. + *
+ *
+ */ +struct BootstrapProfile { + 1: required string name, + 2: required BootstrapSettings settings, +} + +/** + * This structure describes a collection of bootstrap profiles. + *
+ *
profiles:
+ *
+ * List of one or more bootstrap profiles, in descending + * preference order. + *
+ *
+ */ +struct BootstrapInfo { + 1: required list profiles +} + +/** + * Service: UserStore + *

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

+ * All calls which require an authenticationToken may throw an + * EDAMUserException for the following reasons: + *
    + *
  • AUTH_EXPIRED "authenticationToken" - token has expired + *
  • BAD_DATA_FORMAT "authenticationToken" - token is malformed + *
  • DATA_REQUIRED "authenticationToken" - token is empty + *
  • INVALID_AUTH "authenticationToken" - token signature is invalid + *
  • PERMISSION_DENIED "authenticationToken" - token does not convey sufficient + * privileges + *
+ */ +service UserStore { + + /** + * This should be the first call made by a client to the EDAM service. It + * tells the service what protocol version is used by the client. The + * service will then return true if the client is capable of talking to + * the service, and false if the client's protocol version is incompatible + * with the service, so the client must upgrade. If a client receives a + * false value, it should report the incompatibility to the user and not + * continue with any more EDAM requests (UserStore or NoteStore). + * + * @param clientName + * This string provides some information about the client for + * tracking/logging on the service. It should provide information about + * the client's software and platform. The structure should be: + * application/version; platform/version; [ device/version ] + * E.g. "Evernote Windows/3.0.1; Windows/XP SP3". + * + * @param edamVersionMajor + * This should be the major protocol version that was compiled by the + * client. This should be the current value of the EDAM_VERSION_MAJOR + * constant for the client. + * + * @param edamVersionMinor + * This should be the major protocol version that was compiled by the + * client. This should be the current value of the EDAM_VERSION_MINOR + * constant for the client. + */ + bool checkVersion(1: string clientName, + 2: i16 edamVersionMajor = EDAM_VERSION_MAJOR, + 3: i16 edamVersionMinor = EDAM_VERSION_MINOR), + + /** + * This provides bootstrap information to the client. Various bootstrap + * profiles and settings may be used by the client to configure itself. + * + * @param locale + * The client's current locale, expressed in language[_country] + * format. E.g., "en_US". See ISO-639 and ISO-3166 for valid + * language and country codes. + * + * @return + * The bootstrap information suitable for this client. + */ + BootstrapInfo getBootstrapInfo(1: string locale), + + /** + * This is used to check a username and password in order to create a + * long-lived authentication token that can be used for further actions. + * + * This function is not available to most third party applications, + * which typically authenticate using OAuth as + * described at + * dev.evernote.com. + * If you believe that your application requires permission to authenticate + * using username and password instead of OAuth, please contact Evernote + * developer support by visiting + * dev.evernote.com. + * + * @param username + * The username or registered email address of the account to + * authenticate against. + * + * @param password + * The plaintext password to check against the account. Since + * this is not protected by the EDAM protocol, this information must be + * provided over a protected transport (i.e. SSL). + * + * @param consumerKey + * The "consumer key" portion of the API key issued to the client application + * by Evernote. + * + * @param consumerSecret + * The "consumer secret" portion of the API key issued to the client application + * by Evernote. + * + * @param deviceIdentifier + * An optional string that uniquely identifies the device from which the + * authentication is being performed. This string allows the service to return the + * same authentication token when a given application requests authentication + * repeatedly from the same device. This may happen when the user logs out of an + * application and then logs back in, or when the application is uninstalled + * and later reinstalled. If no reliable device identifier can be created, + * this value should be omitted. If set, the device identifier must be between + * 1 and EDAM_DEVICE_ID_LEN_MAX characters long and must match the regular expression + * EDAM_DEVICE_ID_REGEX. + * + * @param deviceDescription + * A description of the device from which the authentication is being performed. + * This field is displayed to the user in a list of authorized applications to + * allow them to distinguish between multiple tokens issued to the same client + * application on different devices. For example, the Evernote iOS client on + * a user's iPhone and iPad might pass the iOS device names "Bob's iPhone" and + * "Bob's iPad". The device description must be between 1 and + * EDAM_DEVICE_DESCRIPTION_LEN_MAX characters long and must match the regular + * expression EDAM_DEVICE_DESCRIPTION_REGEX. + * + * @param supportsTwoFactor + * Whether the calling application supports two-factor authentication. If this + * parameter is false, this method will fail with the error code INVALID_AUTH and the + * parameter "password" when called for a user who has enabled two-factor + * authentication. + * + * @return + *

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

+ *

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

+ * + * @throws EDAMUserException
    + *
  • DATA_REQUIRED "username" - username is empty + *
  • DATA_REQUIRED "password" - password is empty + *
  • DATA_REQUIRED "consumerKey" - consumerKey is empty + *
  • DATA_REQUIRED "consumerSecret" - consumerSecret is empty + *
  • DATA_REQUIRED "deviceDescription" - deviceDescription is empty + *
  • BAD_DATA_FORMAT "deviceDescription" - deviceDescription is not valid. + *
  • BAD_DATA_FORMAT "deviceIdentifier" - deviceIdentifier is not valid. + *
  • INVALID_AUTH "username" - username not found + *
  • INVALID_AUTH "password" - password did not match + *
  • INVALID_AUTH "consumerKey" - consumerKey is not authorized + *
  • INVALID_AUTH "consumerSecret" - consumerSecret is incorrect + *
  • INVALID_AUTH "businessOnly" - the user is a business-only account + *
  • PERMISSION_DENIED "User.active" - user account is closed + *
  • PERMISSION_DENIED "User.tooManyFailuresTryAgainLater" - user has + * failed authentication too often + *
  • AUTH_EXPIRED "password" - user password is expired + *
+ */ + AuthenticationResult authenticateLongSession(1: string username, + 2: string password, + 3: string consumerKey, + 4: string consumerSecret, + 5: string deviceIdentifier, + 6: string deviceDescription, + 7: bool supportsTwoFactor) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Complete the authentication process when a second factor is required. This + * call is made after a successful call to authenticate or authenticateLongSession + * when the authenticating user has enabled two-factor authentication. + * + * @param authenticationToken An authentication token returned by a previous + * call to UserStore.authenticate or UserStore.authenticateLongSession that + * could not be completed in a single call because a second factor was required. + * + * @param oneTimeCode The one time code entered by the user. This value is delivered + * out-of-band, typically via SMS or an authenticator application. + * + * @param deviceIdentifier See the corresponding parameter in authenticateLongSession. + * + * @param deviceDescription See the corresponding parameter in authenticateLongSession. + * + * @return + * The result of the authentication. The level of detail provided in the returned + * AuthenticationResult.User structure depends on the access level granted by the + * calling application's API key. If the initial authentication call was made to + * authenticateLongSession, the AuthenticationResult will contain a long-lived + * authentication token. + * + * @throws EDAMUserException
    + *
  • DATA_REQUIRED "authenticationToken" - authenticationToken is empty + *
  • DATA_REQUIRED "oneTimeCode" - oneTimeCode is empty + *
  • BAD_DATA_FORMAT "deviceIdentifier" - deviceIdentifier is not valid + *
  • BAD_DATA_FORMAT "authenticationToken" - authenticationToken is not well formed + *
  • INVALID_AUTH "oneTimeCode" - oneTimeCode did not match + *
  • AUTH_EXPIRED "authenticationToken" - authenticationToken has expired + *
  • PERMISSION_DENIED "authenticationToken" - authenticationToken is not valid + *
  • PERMISSION_DENIED "User.active" - user account is closed + *
  • PERMISSION_DENIED "User.tooManyFailuresTryAgainLater" - user has + * failed authentication too often + *
  • DATA_CONFLICT "User.twoFactorAuthentication" - The user has not enabled + * two-factor authentication.
  • + *
+ */ + AuthenticationResult completeTwoFactorAuthentication(1: string authenticationToken, + 2: string oneTimeCode, + 3: string deviceIdentifier, + 4: string deviceDescription) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Revoke an existing long lived authentication token. This can be used to + * revoke OAuth tokens or tokens created by calling authenticateLongSession, + * and allows a user to effectively log out of Evernote from the perspective + * of the application that holds the token. The authentication token that is + * passed is immediately revoked and may not be used to call any authenticated + * EDAM function. + * + * @param authenticationToken the authentication token to revoke. + * + * @throws EDAMUserException
    + *
  • DATA_REQUIRED "authenticationToken" - no authentication token provided + *
  • BAD_DATA_FORMAT "authenticationToken" - the authentication token is not well formed + *
  • INVALID_AUTH "authenticationToken" - the authentication token is invalid + *
  • AUTH_EXPIRED "authenticationToken" - the authentication token is expired or + * is already revoked. + *
+ */ + void revokeLongSession(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * This is used to take an existing authentication token that grants access + * to an individual user account (returned from 'authenticate', + * 'authenticateLongSession' or an OAuth authorization) and obtain an additional + * authentication token that may be used to access business notebooks if the user + * is a member of an Evernote Business account. + * + * The resulting authentication token may be used to make NoteStore API calls + * against the business using the NoteStore URL returned in the result. + * + * @param authenticationToken + * The authentication token for the user. This may not be a shared authentication + * token (returned by NoteStore.authenticateToSharedNotebook or + * NoteStore.authenticateToSharedNote) or a business authentication token. + * + * @return + * The result of the authentication, with the token granting access to the + * business in the result's 'authenticationToken' field. The URL that must + * be used to access the business account NoteStore will be returned in the + * result's 'noteStoreUrl' field. The 'User' field will + * not be set in the result. + * + * @throws EDAMUserException
    + *
  • PERMISSION_DENIED "authenticationToken" - the provided authentication token + * is a shared or business authentication token.
  • + *
  • PERMISSION_DENIED "Business" - the user identified by the provided + * authentication token is not currently a member of a business.
  • + *
  • PERMISSION_DENIED "Business.status" - the business that the user is a + * member of is not currently in an active status.
  • + *
  • BUSINESS_SECURITY_LOGIN_REQUIRED "sso" - the user must complete single + * sign-on before authenticating to the business. + *
+ */ + AuthenticationResult authenticateToBusiness(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Returns the User corresponding to the provided authentication token, + * or throws an exception if this token is not valid. + * The level of detail provided in the returned User structure depends on + * the access level granted by the token, so a web service client may receive + * fewer fields than an integrated desktop client. + */ + Types.User getUser(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Asks the UserStore about the publicly available location information for + * a particular username. + * + * @throws EDAMUserException
    + *
  • DATA_REQUIRED "username" - username is empty + *
+ */ + PublicUserInfo getPublicUserInfo(1: string username) + throws (1: Errors.EDAMNotFoundException notFoundException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMUserException userException), + + /** + *

Returns the URLs that should be used when sending requests to the service on + * behalf of the account represented by the provided authenticationToken.

+ * + *

This method isn't needed by most clients, who can retreive the correct set of + * UserUrls from the AuthenticationResult returned from + * UserStore#authenticateLongSession(). This method is typically only needed to look up + * the correct URLs for an existing long-lived authentication token.

+ */ + + UserUrls getUserUrls(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Invite a user to join an Evernote Business account. + * + * Behavior will depend on the auth token.
    + *
  1. + * auth token with privileges to manage Evernote Business membership. + * "External Provisioning" - The user will receive an email inviting + * them to join the business. They do not need to have an existing Evernote + * account. If the user has already been invited, a new invitation email + * will be sent. + *
  2. + *
  3. + * business auth token issued to an admin user. Only for first-party clients: + * "Approve Invitation" - If there has been a request to invite the email, + * approve it. Invited user will receive email with a link to join business. + * "Invite User" - If no invitation for the email exists, create an approved + * invitation for the email. An email will be sent to the emailAddress with + * a link to join the caller's business. + *
  4. + * + * business auth token: + * "Request Invitation" - If no invitation exists, create a request to + * invite the user to the business. These requests do not count towards a + * business' max active user limit. + * + *
+ * + * @param authenticationToken + * the authentication token with sufficient privileges to manage Evernote Business + * membership or a business auth token. + * + * @param emailAddress + * the email address of the user to invite to join the Evernote Business account. + * + * @throws EDAMUserException
    + *
  • DATA_REQUIRED "email" - if no email address was provided
  • + *
  • BAD_DATA_FORMAT "email" - if the email address is not well formed
  • + *
  • DATA_CONFLICT "BusinessUser.email" - if there is already a user in the business + * whose business email address matches the specified email address.
  • + *
  • LIMIT_REACHED "Business.maxActiveUsers" - if the business has reached its + * user limit.
  • + *
+ */ + void inviteToBusiness(1: string authenticationToken, + 2: string emailAddress) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Remove a user from an Evernote Business account. Once removed, the user will no + * longer be able to access content within the Evernote Business account. + * + *

The email address of the user to remove from the business must match the email + * address used to invite a user to join the business via UserStore.inviteToBusiness. + * This function will only remove users who were invited by external provisioning

+ * + * @param authenticationToken + * An authentication token with sufficient privileges to manage Evernote Business + * membership. + * + * @param emailAddress + * The email address of the user to remove from the Evernote Business account. + * + * @throws EDAMUserException
    + *
  • DATA_REQUIRED "email" - if no email address was provided
  • + *
  • BAD_DATA_FORMAT "email" - The email address is not well formed
  • + *
+ * @throws EDAMNotFoundException
    + *
  • "email" - If there is no user with the specified email address in the + * business or that user was not invited via external provisioning.
  • + *
+ */ + void removeFromBusiness(1: string authenticationToken, + 2: string emailAddress) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Update the email address used to uniquely identify an Evernote Business user. + * + * This will update the identifier for a user who was previously invited using + * inviteToBusiness, ensuring that caller and the Evernote service maintain an + * agreed-upon identifier for a specific user. + * + * For example, the following sequence of calls would invite a user to join + * a business, update their email address, and then remove the user + * from the business using the updated email address. + * + * inviteToBusiness("foo@bar.com") + * updateBusinessUserIdentifier("foo@bar.com", "baz@bar.com") + * removeFromBusiness("baz@bar.com") + * + * @param authenticationToken + * An authentication token with sufficient privileges to manage Evernote Business + * membership. + * + * @param oldEmailAddress + * The existing email address used to uniquely identify the user. + * + * @param newEmailAddress + * The new email address used to uniquely identify the user. + * + * @throws EDAMUserException
    + *
  • DATA_REQUIRED "oldEmailAddress" - No old email address was provided
  • + *
  • DATA_REQUIRED "newEmailAddress" - No new email address was provided
  • + *
  • BAD_DATA_FORMAT "oldEmailAddress" - The old email address is not well formed
  • + *
  • BAD_DATA_FORMAT "newEmailAddress" - The new email address is not well formed
  • + *
  • DATA_CONFLICT "oldEmailAddress" - The old and new email addresses were the same
  • + *
  • DATA_CONFLICT "newEmailAddress" - There is already an invitation or registered user with + * the provided new email address.
  • + *
  • DATA_CONFLICT "invitation.externallyProvisioned" - The user identified by + * oldEmailAddress was not added via UserStore.inviteToBusiness and therefore cannot be + * updated.
  • + *
+ * @throws EDAMNotFoundException
    + *
  • "oldEmailAddress" - If there is no user or invitation with the specified oldEmailAddress + * in the business.
  • + *
+ */ + void updateBusinessUserIdentifier(1: string authenticationToken, + 2: string oldEmailAddress, + 3: string newEmailAddress) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException, + 3: Errors.EDAMNotFoundException notFoundException), + + /** + * Returns a list of active business users in a given business. + * + * Clients are required to cache this information and re-fetch no more than once per day + * or when they encountered a user ID or username that was not known to them. + * + * To avoid excessive look ups, clients should also track user IDs and usernames that belong + * to users who are not in the business, since they will not be included in the result. + * + * I.e., when a client encounters a previously unknown user ID as a note's creator, it may query + * listBusinessUsers to find information about this user. If the user is not in the resulting + * list, the client should track that fact and not re-query the service the next time that it sees + * this user on a note. + * + * @param authenticationToken + * A business authentication token returned by authenticateToBusiness or with sufficient + * privileges to manage Evernote Business membership. + */ + list listBusinessUsers(1: string authenticationToken) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Returns a list of outstanding invitations to join an Evernote Business account. + * + * Only outstanding invitations are returned by this function. Users who have accepted an + * invitation and joined a business are listed using listBusinessUsers. + * + * @param authenticationToken + * An authentication token with sufficient privileges to manage Evernote Business membership. + * + * @param includeRequestedInvitations + * If true, invitations with a status of BusinessInvitationStatus.REQUESTED will be included + * in the returned list. If false, only invitations with a status of + * BusinessInvitationStatus.APPROVED will be included. + */ + list listBusinessInvitations(1: string authenticationToken, + 2: bool includeRequestedInvitations) + throws (1: Errors.EDAMUserException userException, + 2: Errors.EDAMSystemException systemException), + + /** + * Retrieve the standard account limits for a given service level. This should only be + * called when necessary, e.g. to determine if a higher level is available should the + * user upgrade, and should be cached for long periods (e.g. 30 days) as the values are + * not expected to fluctuate frequently. + * + * @throws EDAMUserException
    + *
  • DATA_REQUIRED "serviceLevel" - serviceLevel is null
  • + *
+ */ + Types.AccountLimits getAccountLimits(1: Types.ServiceLevel serviceLevel) + throws (1: Errors.EDAMUserException userException), +} -- 2.51.2